Class ModelHandler

  • public class ModelHandler
    extends java.lang.Object
    Reads a model and creates schema objects accordingly.
    • Field Detail


        private static final com.fasterxml.jackson.databind.ObjectMapper JSON_MAPPER

        private static final com.fasterxml.jackson.databind.ObjectMapper YAML_MAPPER
      • schemaStack

        private final java.util.Deque<Pair<java.lang.String,​SchemaPlus>> schemaStack
      • modelUri

        private final java.lang.String modelUri
    • Constructor Detail

      • ModelHandler

        public ModelHandler​(CalciteConnection connection,
                            java.lang.String uri)
    • Method Detail

      • addFunctions

        public static void addFunctions​(SchemaPlus schema,
                                        java.lang.String functionName,
                                        java.util.List<java.lang.String> path,
                                        java.lang.String className,
                                        java.lang.String methodName,
                                        boolean upCase)
        Creates and validates a ScalarFunctionImpl, and adds it to a schema. If methodName is "*", may add more than one function.
        schema - Schema to add to
        functionName - Name of function; null to derived from method name
        path - Path to look for functions
        className - Class to inspect for methods that may be user-defined functions
        methodName - Method name; null means use the class as a UDF; "*" means add all methods
        upCase - Whether to convert method names to upper case, so that they can be called without using quotes
      • checkRequiredAttributes

        private void checkRequiredAttributes​(java.lang.Object json,
                                             java.lang.String... attributeNames)
      • visit

        public void visit​(JsonRoot jsonRoot)
      • stringListList

        private static<<java.lang.String>> stringListList​(java.util.List path)
      • stringList

        private static<java.lang.String> stringList​(java.lang.Object s)
      • operandMap

        protected java.util.Map<java.lang.String,​java.lang.Object> operandMap​(JsonSchema jsonSchema,
                                                                                    java.util.Map<java.lang.String,​java.lang.Object> operand)
        Adds extra entries to an operand to a custom schema.
      • visit

        public void visit​(JsonLattice jsonLattice)
      • visit

        public void visit​(JsonColumn jsonColumn)
      • visit

        public void visit​(JsonView jsonView)
      • currentSchemaPath

        private java.util.List<java.lang.String> currentSchemaPath()
      • currentSchema

        private SchemaPlus currentSchema()
      • currentSchemaName

        private java.lang.String currentSchemaName()
      • currentMutableSchema

        private SchemaPlus currentMutableSchema​(java.lang.String elementType)
      • visit

        public void visit​(JsonType jsonType)
      • visit

        public void visit​(JsonMeasure jsonMeasure)
      • visit

        public void visit​(JsonTile jsonTile)