class Table(DataClass("Table", [ "name", "url", "query_path", "timestamp" ])): @property def columns(self): return FromESMetadata.singlton.get_columns(table_name=self.name)
Column = DataClass( "Column", [ "name", "table", "es_column", "es_index", "type", { "name": "useSource", "default": False }, { "name": "nested_path", "nulls": True }, # AN ARRAY OF PATHS (FROM DEEPEST TO SHALLOWEST) INDICATING THE JSON SUB-ARRAYS { "name": "relative", "nulls": True }, { "name": "count", "nulls": True }, { "name": "cardinality", "nulls": True }, { "name": "partitions", "nulls": True }, { "name": "last_updated", "nulls": True } ])
"timestamp" ])): @property def columns(self): return FromESMetadata.singlton.get_columns(table_name=self.name) Column = DataClass( "Column", [ # "table", "names", # MAP FROM TABLE NAME TO COLUMN NAME (ONE COLUMN CAN HAVE MULTIPLE NAMES) "es_column", "es_index", # "es_type", "type", {"name": "useSource", "default": False}, {"name": "nested_path", "nulls": True}, # AN ARRAY OF PATHS (FROM DEEPEST TO SHALLOWEST) INDICATING THE JSON SUB-ARRAYS {"name": "count", "nulls": True}, {"name": "cardinality", "nulls": True}, {"name": "partitions", "nulls": True}, {"name": "last_updated", "nulls": True} ] ) class ColumnList(Container): """ OPTIMIZED FOR THE PARTICULAR ACCESS PATTERNS USED """
ColumnMapping = DataClass( "ColumnMapping", [ { # EDGES ARE AUTOMATICALLY INCLUDED IN THE OUTPUT, USE THIS TO INDICATE EDGES SO WE DO NOT DOUBLE-PRINT "name":"is_edge", "default": False }, { # TRACK NUMBER OF TABLE COLUMNS THIS column REPRESENTS "name":"num_push_columns", "nulls": True }, { # NAME OF THE PROPERTY (USED BY LIST FORMAT ONLY) "name": "push_name", "nulls": True }, { # PATH INTO COLUMN WHERE VALUE IS STORED ("." MEANS COLUMN HOLDS PRIMITIVE VALUE) "name": "push_child", "nulls": True }, { # THE COLUMN NUMBER "name": "push_column", "nulls": True }, { # THE COLUMN NAME FOR TABLES AND CUBES (WITH NO ESCAPING DOTS, NOT IN LEAF FORM) "name": "push_column_name", "nulls": True }, { # A FUNCTION THAT WILL RETURN A VALUE "name": "pull", "nulls": True }, { # A LIST OF MULTI-SQL REQUIRED TO GET THE VALUE FROM THE DATABASE "name": "sql", "type": list }, "type", # THE NAME OF THE JSON DATA TYPE EXPECTED { # A LIST OF PATHS EACH INDICATING AN ARRAY "name": "nested_path", "type": list, "default": ["."] }, "column_alias" ], constraint={"and": [ {"in": {"type": ["null", "boolean", "number", "string", "object"]}}, {"gte": [{"length": "nested_path"}, 1]} ]} )