diff --git a/adapters/arrow/dev.local.configuration.json b/adapters/arrow/configuration.json similarity index 100% rename from adapters/arrow/dev.local.configuration.json rename to adapters/arrow/configuration.json diff --git a/adapters/bigquery/dev.local.configuration.json b/adapters/bigquery/configuration.json similarity index 100% rename from adapters/bigquery/dev.local.configuration.json rename to adapters/bigquery/configuration.json diff --git a/adapters/cassandra/configuration.json b/adapters/cassandra/configuration.json index 30ca60b..f4747b6 100644 --- a/adapters/cassandra/configuration.json +++ b/adapters/cassandra/configuration.json @@ -1,6 +1,330 @@ { - "version": "5", - "$schema": "schema.json", - "model_file_path": "/etc/connector/model.json", - "fixes": true -} + "version": "5", + "$schema": "schema.json", + "model": { + "version": "1.0", + "defaultSchema": "twissandra", + "schemas": [ + { + "type": "custom", + "name": "twissandra", + "sqlDialectFactory": null, + "jdbcUser": null, + "jdbcPassword": null, + "jdbcUrl": null, + "jdbcCatalog": null, + "jdbcSchema": null, + "factory": "org.apache.calcite.adapter.cassandra.CassandraSchemaFactory", + "operand": { + "host": "cassandra.us-west-1.amazonaws.com", + "port": 9142, + "password": "thfXHbP4KMRH8Je//SsoISZyOq/SNE3ltg40WIreGhcfGNVKsLqFwZwSQfc=", + "username": "athenauser-at-528956693660", + "keyspace": "content_data", + "ssl": true, + "dc": "us-west-1", + "pathToRootCert": "/Users/kennethstott/Documents/GitHub/calcite-connector/adapters/cassandra/root.crt" + } + } + ] + }, + "model_file_path": "/Users/kennethstott/Documents/GitHub/calcite-connector/adapters/cassandra/model.json", + "fixes": true, + "metadata": { + "news_articles_by_source": { + "physicalSchema": "twissandra", + "catalog": "", + "schema": "twissandra", + "name": "news_articles_by_source", + "columns": { + "metadata": { + "name": "metadata", + "scalarType": "MAP", + "nullable": true + }, + "publish_date": { + "name": "publish_date", + "scalarType": "TIMESTAMP", + "nullable": true + }, + "title": { + "name": "title", + "scalarType": "VARCHAR", + "nullable": true + }, + "content": { + "name": "content", + "scalarType": "VARCHAR", + "nullable": true + }, + "tags": { + "name": "tags", + "scalarType": "LIST", + "nullable": true + }, + "article_id": { + "name": "article_id", + "scalarType": "VARCHAR", + "nullable": true + }, + "comments": { + "name": "comments", + "scalarType": "LIST", + "nullable": true + }, + "alias": { + "name": "alias", + "scalarType": "VARCHAR", + "nullable": true + }, + "author_id": { + "name": "author_id", + "scalarType": "VARCHAR", + "nullable": true + }, + "source": { + "name": "source", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "all_data_types_example": { + "physicalSchema": "twissandra", + "catalog": "", + "schema": "twissandra", + "name": "all_data_types_example", + "columns": { + "is_active": { + "name": "is_active", + "scalarType": "BOOLEAN", + "nullable": true + }, + "coordinates": { + "name": "coordinates", + "scalarType": "VARCHAR", + "nullable": true + }, + "ip_address": { + "name": "ip_address", + "scalarType": "VARBINARY", + "nullable": true + }, + "tags": { + "name": "tags", + "scalarType": "VARCHAR", + "nullable": true + }, + "serial_no": { + "name": "serial_no", + "scalarType": "INTEGER", + "nullable": true + }, + "rank": { + "name": "rank", + "scalarType": "INTEGER", + "nullable": true + }, + "birth_date": { + "name": "birth_date", + "scalarType": "DATE", + "nullable": true + }, + "large_number": { + "name": "large_number", + "scalarType": "INTEGER", + "nullable": true + }, + "properties": { + "name": "properties", + "scalarType": "MAP", + "nullable": true + }, + "height": { + "name": "height", + "scalarType": "VARCHAR", + "nullable": true + }, + "weight": { + "name": "weight", + "scalarType": "DOUBLE", + "nullable": true + }, + "random_bytes": { + "name": "random_bytes", + "scalarType": "VARBINARY", + "nullable": true + }, + "name": { + "name": "name", + "scalarType": "VARCHAR", + "nullable": true + }, + "event_timeuuid": { + "name": "event_timeuuid", + "scalarType": "VARCHAR", + "nullable": true + }, + "indicator": { + "name": "indicator", + "scalarType": "INTEGER", + "nullable": true + }, + "id": { + "name": "id", + "scalarType": "VARCHAR", + "nullable": true + }, + "frozen_list": { + "name": "frozen_list", + "scalarType": "LIST", + "nullable": true + }, + "preferences": { + "name": "preferences", + "scalarType": "LIST", + "nullable": true + }, + "registration_timestamp": { + "name": "registration_timestamp", + "scalarType": "TIMESTAMP", + "nullable": true + }, + "birth_time": { + "name": "birth_time", + "scalarType": "INTEGER", + "nullable": true + }, + "score": { + "name": "score", + "scalarType": "DOUBLE", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "news_articles_by_id": { + "physicalSchema": "twissandra", + "catalog": "", + "schema": "twissandra", + "name": "news_articles_by_id", + "columns": { + "metadata": { + "name": "metadata", + "scalarType": "MAP", + "nullable": true + }, + "comments": { + "name": "comments", + "scalarType": "LIST", + "nullable": true + }, + "source": { + "name": "source", + "scalarType": "VARCHAR", + "nullable": true + }, + "content": { + "name": "content", + "scalarType": "VARCHAR", + "nullable": true + }, + "tags": { + "name": "tags", + "scalarType": "LIST", + "nullable": true + }, + "author_id": { + "name": "author_id", + "scalarType": "VARCHAR", + "nullable": true + }, + "article_id": { + "name": "article_id", + "scalarType": "VARCHAR", + "nullable": true + }, + "alias": { + "name": "alias", + "scalarType": "VARCHAR", + "nullable": true + }, + "title": { + "name": "title", + "scalarType": "VARCHAR", + "nullable": true + }, + "publish_date": { + "name": "publish_date", + "scalarType": "TIMESTAMP", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "news_articles": { + "physicalSchema": "twissandra", + "catalog": "", + "schema": "twissandra", + "name": "news_articles", + "columns": { + "article_id": { + "name": "article_id", + "scalarType": "VARCHAR", + "nullable": true + }, + "comments": { + "name": "comments", + "scalarType": "LIST", + "nullable": true + }, + "author_id": { + "name": "author_id", + "scalarType": "VARCHAR", + "nullable": true + }, + "metadata": { + "name": "metadata", + "scalarType": "MAP", + "nullable": true + }, + "source": { + "name": "source", + "scalarType": "VARCHAR", + "nullable": true + }, + "title": { + "name": "title", + "scalarType": "VARCHAR", + "nullable": true + }, + "publish_date": { + "name": "publish_date", + "scalarType": "TIMESTAMP", + "nullable": true + }, + "content": { + "name": "content", + "scalarType": "VARCHAR", + "nullable": true + }, + "tags": { + "name": "tags", + "scalarType": "LIST", + "nullable": true + }, + "alias": { + "name": "alias", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + } + } +} \ No newline at end of file diff --git a/adapters/cassandra/dev.local.configuration.json b/adapters/cassandra/dev.local.configuration.json deleted file mode 100644 index f4747b6..0000000 --- a/adapters/cassandra/dev.local.configuration.json +++ /dev/null @@ -1,330 +0,0 @@ -{ - "version": "5", - "$schema": "schema.json", - "model": { - "version": "1.0", - "defaultSchema": "twissandra", - "schemas": [ - { - "type": "custom", - "name": "twissandra", - "sqlDialectFactory": null, - "jdbcUser": null, - "jdbcPassword": null, - "jdbcUrl": null, - "jdbcCatalog": null, - "jdbcSchema": null, - "factory": "org.apache.calcite.adapter.cassandra.CassandraSchemaFactory", - "operand": { - "host": "cassandra.us-west-1.amazonaws.com", - "port": 9142, - "password": "thfXHbP4KMRH8Je//SsoISZyOq/SNE3ltg40WIreGhcfGNVKsLqFwZwSQfc=", - "username": "athenauser-at-528956693660", - "keyspace": "content_data", - "ssl": true, - "dc": "us-west-1", - "pathToRootCert": "/Users/kennethstott/Documents/GitHub/calcite-connector/adapters/cassandra/root.crt" - } - } - ] - }, - "model_file_path": "/Users/kennethstott/Documents/GitHub/calcite-connector/adapters/cassandra/model.json", - "fixes": true, - "metadata": { - "news_articles_by_source": { - "physicalSchema": "twissandra", - "catalog": "", - "schema": "twissandra", - "name": "news_articles_by_source", - "columns": { - "metadata": { - "name": "metadata", - "scalarType": "MAP", - "nullable": true - }, - "publish_date": { - "name": "publish_date", - "scalarType": "TIMESTAMP", - "nullable": true - }, - "title": { - "name": "title", - "scalarType": "VARCHAR", - "nullable": true - }, - "content": { - "name": "content", - "scalarType": "VARCHAR", - "nullable": true - }, - "tags": { - "name": "tags", - "scalarType": "LIST", - "nullable": true - }, - "article_id": { - "name": "article_id", - "scalarType": "VARCHAR", - "nullable": true - }, - "comments": { - "name": "comments", - "scalarType": "LIST", - "nullable": true - }, - "alias": { - "name": "alias", - "scalarType": "VARCHAR", - "nullable": true - }, - "author_id": { - "name": "author_id", - "scalarType": "VARCHAR", - "nullable": true - }, - "source": { - "name": "source", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "all_data_types_example": { - "physicalSchema": "twissandra", - "catalog": "", - "schema": "twissandra", - "name": "all_data_types_example", - "columns": { - "is_active": { - "name": "is_active", - "scalarType": "BOOLEAN", - "nullable": true - }, - "coordinates": { - "name": "coordinates", - "scalarType": "VARCHAR", - "nullable": true - }, - "ip_address": { - "name": "ip_address", - "scalarType": "VARBINARY", - "nullable": true - }, - "tags": { - "name": "tags", - "scalarType": "VARCHAR", - "nullable": true - }, - "serial_no": { - "name": "serial_no", - "scalarType": "INTEGER", - "nullable": true - }, - "rank": { - "name": "rank", - "scalarType": "INTEGER", - "nullable": true - }, - "birth_date": { - "name": "birth_date", - "scalarType": "DATE", - "nullable": true - }, - "large_number": { - "name": "large_number", - "scalarType": "INTEGER", - "nullable": true - }, - "properties": { - "name": "properties", - "scalarType": "MAP", - "nullable": true - }, - "height": { - "name": "height", - "scalarType": "VARCHAR", - "nullable": true - }, - "weight": { - "name": "weight", - "scalarType": "DOUBLE", - "nullable": true - }, - "random_bytes": { - "name": "random_bytes", - "scalarType": "VARBINARY", - "nullable": true - }, - "name": { - "name": "name", - "scalarType": "VARCHAR", - "nullable": true - }, - "event_timeuuid": { - "name": "event_timeuuid", - "scalarType": "VARCHAR", - "nullable": true - }, - "indicator": { - "name": "indicator", - "scalarType": "INTEGER", - "nullable": true - }, - "id": { - "name": "id", - "scalarType": "VARCHAR", - "nullable": true - }, - "frozen_list": { - "name": "frozen_list", - "scalarType": "LIST", - "nullable": true - }, - "preferences": { - "name": "preferences", - "scalarType": "LIST", - "nullable": true - }, - "registration_timestamp": { - "name": "registration_timestamp", - "scalarType": "TIMESTAMP", - "nullable": true - }, - "birth_time": { - "name": "birth_time", - "scalarType": "INTEGER", - "nullable": true - }, - "score": { - "name": "score", - "scalarType": "DOUBLE", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "news_articles_by_id": { - "physicalSchema": "twissandra", - "catalog": "", - "schema": "twissandra", - "name": "news_articles_by_id", - "columns": { - "metadata": { - "name": "metadata", - "scalarType": "MAP", - "nullable": true - }, - "comments": { - "name": "comments", - "scalarType": "LIST", - "nullable": true - }, - "source": { - "name": "source", - "scalarType": "VARCHAR", - "nullable": true - }, - "content": { - "name": "content", - "scalarType": "VARCHAR", - "nullable": true - }, - "tags": { - "name": "tags", - "scalarType": "LIST", - "nullable": true - }, - "author_id": { - "name": "author_id", - "scalarType": "VARCHAR", - "nullable": true - }, - "article_id": { - "name": "article_id", - "scalarType": "VARCHAR", - "nullable": true - }, - "alias": { - "name": "alias", - "scalarType": "VARCHAR", - "nullable": true - }, - "title": { - "name": "title", - "scalarType": "VARCHAR", - "nullable": true - }, - "publish_date": { - "name": "publish_date", - "scalarType": "TIMESTAMP", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "news_articles": { - "physicalSchema": "twissandra", - "catalog": "", - "schema": "twissandra", - "name": "news_articles", - "columns": { - "article_id": { - "name": "article_id", - "scalarType": "VARCHAR", - "nullable": true - }, - "comments": { - "name": "comments", - "scalarType": "LIST", - "nullable": true - }, - "author_id": { - "name": "author_id", - "scalarType": "VARCHAR", - "nullable": true - }, - "metadata": { - "name": "metadata", - "scalarType": "MAP", - "nullable": true - }, - "source": { - "name": "source", - "scalarType": "VARCHAR", - "nullable": true - }, - "title": { - "name": "title", - "scalarType": "VARCHAR", - "nullable": true - }, - "publish_date": { - "name": "publish_date", - "scalarType": "TIMESTAMP", - "nullable": true - }, - "content": { - "name": "content", - "scalarType": "VARCHAR", - "nullable": true - }, - "tags": { - "name": "tags", - "scalarType": "LIST", - "nullable": true - }, - "alias": { - "name": "alias", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - } - } -} \ No newline at end of file diff --git a/adapters/csv/configuration.json b/adapters/csv/configuration.json index cef05dd..010bef2 100644 --- a/adapters/csv/configuration.json +++ b/adapters/csv/configuration.json @@ -6,8 +6,8 @@ "defaultSchema": "SALES", "schemas": [ { - "name": "SALES", "type": "custom", + "name": "SALES", "factory": "org.apache.calcite.adapter.csv.CsvSchemaFactory", "operand": { "directory": "./resources/test/sales" @@ -15,5 +15,102 @@ } ] }, - "fixes": true -} + "model_file_path": "./model.json", + "fixes": true, + "metadata": { + "SDEPTS": { + "schema": "SALES", + "name": "SDEPTS", + "columns": { + "NAME": { + "name": "NAME", + "scalarType": "VARCHAR", + "nullable": true + }, + "DEPTNO": { + "name": "DEPTNO", + "scalarType": "INTEGER", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "EMPS": { + "schema": "SALES", + "name": "EMPS", + "columns": { + "DEPTNO": { + "name": "DEPTNO", + "scalarType": "INTEGER", + "nullable": true + }, + "NAME": { + "name": "NAME", + "scalarType": "VARCHAR", + "nullable": true + }, + "EMPID": { + "name": "EMPID", + "scalarType": "INTEGER", + "nullable": true + }, + "EMPNO": { + "name": "EMPNO", + "scalarType": "INTEGER", + "nullable": true + }, + "JOINEDAT": { + "name": "JOINEDAT", + "scalarType": "DATE", + "nullable": true + }, + "AGE": { + "name": "AGE", + "scalarType": "INTEGER", + "nullable": true + }, + "SLACKER": { + "name": "SLACKER", + "scalarType": "BOOLEAN", + "nullable": true + }, + "CITY": { + "name": "CITY", + "scalarType": "VARCHAR", + "nullable": true + }, + "GENDER": { + "name": "GENDER", + "scalarType": "VARCHAR", + "nullable": true + }, + "MANAGER": { + "name": "MANAGER", + "scalarType": "BOOLEAN", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "DEPTS": { + "schema": "SALES", + "name": "DEPTS", + "columns": { + "DEPTNO": { + "name": "DEPTNO", + "scalarType": "INTEGER", + "nullable": true + }, + "NAME": { + "name": "NAME", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + } + } +} \ No newline at end of file diff --git a/adapters/csv/dev.local.configuration.json b/adapters/csv/dev.local.configuration.json deleted file mode 100644 index 010bef2..0000000 --- a/adapters/csv/dev.local.configuration.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "version": "5", - "$schema": "schema.json", - "model": { - "version": "1.0", - "defaultSchema": "SALES", - "schemas": [ - { - "type": "custom", - "name": "SALES", - "factory": "org.apache.calcite.adapter.csv.CsvSchemaFactory", - "operand": { - "directory": "./resources/test/sales" - } - } - ] - }, - "model_file_path": "./model.json", - "fixes": true, - "metadata": { - "SDEPTS": { - "schema": "SALES", - "name": "SDEPTS", - "columns": { - "NAME": { - "name": "NAME", - "scalarType": "VARCHAR", - "nullable": true - }, - "DEPTNO": { - "name": "DEPTNO", - "scalarType": "INTEGER", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "EMPS": { - "schema": "SALES", - "name": "EMPS", - "columns": { - "DEPTNO": { - "name": "DEPTNO", - "scalarType": "INTEGER", - "nullable": true - }, - "NAME": { - "name": "NAME", - "scalarType": "VARCHAR", - "nullable": true - }, - "EMPID": { - "name": "EMPID", - "scalarType": "INTEGER", - "nullable": true - }, - "EMPNO": { - "name": "EMPNO", - "scalarType": "INTEGER", - "nullable": true - }, - "JOINEDAT": { - "name": "JOINEDAT", - "scalarType": "DATE", - "nullable": true - }, - "AGE": { - "name": "AGE", - "scalarType": "INTEGER", - "nullable": true - }, - "SLACKER": { - "name": "SLACKER", - "scalarType": "BOOLEAN", - "nullable": true - }, - "CITY": { - "name": "CITY", - "scalarType": "VARCHAR", - "nullable": true - }, - "GENDER": { - "name": "GENDER", - "scalarType": "VARCHAR", - "nullable": true - }, - "MANAGER": { - "name": "MANAGER", - "scalarType": "BOOLEAN", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "DEPTS": { - "schema": "SALES", - "name": "DEPTS", - "columns": { - "DEPTNO": { - "name": "DEPTNO", - "scalarType": "INTEGER", - "nullable": true - }, - "NAME": { - "name": "NAME", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - } - } -} \ No newline at end of file diff --git a/adapters/databricks/configuration.json b/adapters/databricks/configuration.json index 65eecd4..ec8dd05 100644 --- a/adapters/databricks/configuration.json +++ b/adapters/databricks/configuration.json @@ -1,6 +1,418 @@ { "version": "5", "$schema": "schema.json", - "model_file_path": "/Users/kennethstott/test/calcite-connector/adapters/databricks/model.json", - "fixes": true + "model": { + "version": "1.0", + "defaultSchema": "TEST", + "schemas": [ + { + "type": "jdbc", + "name": "TEST", + "sqlDialectFactory": null, + "jdbcUser": null, + "jdbcPassword": null, + "jdbcUrl": "jdbc:databricks://dbc-35019fa9-14d3.cloud.databricks.com:443/;HttpPath=/sql/1.0/warehouses/fd7249aff7e8684c;PWD=dapice663dc29531c32040053109eabdd24f;ConnCatalog=samples;ConnSchema=tpch", + "jdbcCatalog": "samples", + "jdbcSchema": "tpch", + "factory": null + } + ] + }, + "model_file_path": "./model.json", + "fixes": true, + "metadata": { + "region": { + "physicalCatalog": "samples", + "physicalSchema": "tpch", + "catalog": "", + "schema": "TEST", + "name": "region", + "columns": { + "r_name": { + "name": "r_name", + "scalarType": "VARCHAR", + "nullable": true + }, + "r_comment": { + "name": "r_comment", + "scalarType": "VARCHAR", + "nullable": true + }, + "r_regionkey": { + "name": "r_regionkey", + "scalarType": "INTEGER", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "lineitem": { + "physicalCatalog": "samples", + "physicalSchema": "tpch", + "catalog": "", + "schema": "TEST", + "name": "lineitem", + "columns": { + "l_orderkey": { + "name": "l_orderkey", + "scalarType": "INTEGER", + "nullable": true + }, + "l_tax": { + "name": "l_tax", + "scalarType": "FLOAT", + "nullable": true + }, + "l_linestatus": { + "name": "l_linestatus", + "scalarType": "VARCHAR", + "nullable": true + }, + "l_suppkey": { + "name": "l_suppkey", + "scalarType": "INTEGER", + "nullable": true + }, + "l_extendedprice": { + "name": "l_extendedprice", + "scalarType": "FLOAT", + "nullable": true + }, + "l_discount": { + "name": "l_discount", + "scalarType": "FLOAT", + "nullable": true + }, + "l_quantity": { + "name": "l_quantity", + "scalarType": "FLOAT", + "nullable": true + }, + "l_partkey": { + "name": "l_partkey", + "scalarType": "INTEGER", + "nullable": true + }, + "l_receiptdate": { + "name": "l_receiptdate", + "scalarType": "DATE", + "nullable": true + }, + "l_shipmode": { + "name": "l_shipmode", + "scalarType": "VARCHAR", + "nullable": true + }, + "l_returnflag": { + "name": "l_returnflag", + "scalarType": "VARCHAR", + "nullable": true + }, + "l_commitdate": { + "name": "l_commitdate", + "scalarType": "DATE", + "nullable": true + }, + "l_shipdate": { + "name": "l_shipdate", + "scalarType": "DATE", + "nullable": true + }, + "l_linenumber": { + "name": "l_linenumber", + "scalarType": "INTEGER", + "nullable": true + }, + "l_comment": { + "name": "l_comment", + "scalarType": "VARCHAR", + "nullable": true + }, + "l_shipinstruct": { + "name": "l_shipinstruct", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "part": { + "physicalCatalog": "samples", + "physicalSchema": "tpch", + "catalog": "", + "schema": "TEST", + "name": "part", + "columns": { + "p_type": { + "name": "p_type", + "scalarType": "VARCHAR", + "nullable": true + }, + "p_mfgr": { + "name": "p_mfgr", + "scalarType": "VARCHAR", + "nullable": true + }, + "p_partkey": { + "name": "p_partkey", + "scalarType": "INTEGER", + "nullable": true + }, + "p_comment": { + "name": "p_comment", + "scalarType": "VARCHAR", + "nullable": true + }, + "p_retailprice": { + "name": "p_retailprice", + "scalarType": "FLOAT", + "nullable": true + }, + "p_container": { + "name": "p_container", + "scalarType": "VARCHAR", + "nullable": true + }, + "p_name": { + "name": "p_name", + "scalarType": "VARCHAR", + "nullable": true + }, + "p_size": { + "name": "p_size", + "scalarType": "INTEGER", + "nullable": true + }, + "p_brand": { + "name": "p_brand", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "nation": { + "physicalCatalog": "samples", + "physicalSchema": "tpch", + "catalog": "", + "schema": "TEST", + "name": "nation", + "columns": { + "n_name": { + "name": "n_name", + "scalarType": "VARCHAR", + "nullable": true + }, + "n_regionkey": { + "name": "n_regionkey", + "scalarType": "INTEGER", + "nullable": true + }, + "n_comment": { + "name": "n_comment", + "scalarType": "VARCHAR", + "nullable": true + }, + "n_nationkey": { + "name": "n_nationkey", + "scalarType": "INTEGER", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "customer": { + "physicalCatalog": "samples", + "physicalSchema": "tpch", + "catalog": "", + "schema": "TEST", + "name": "customer", + "columns": { + "c_acctbal": { + "name": "c_acctbal", + "scalarType": "FLOAT", + "nullable": true + }, + "c_comment": { + "name": "c_comment", + "scalarType": "VARCHAR", + "nullable": true + }, + "c_phone": { + "name": "c_phone", + "scalarType": "VARCHAR", + "nullable": true + }, + "c_custkey": { + "name": "c_custkey", + "scalarType": "INTEGER", + "nullable": true + }, + "c_address": { + "name": "c_address", + "scalarType": "VARCHAR", + "nullable": true + }, + "c_name": { + "name": "c_name", + "scalarType": "VARCHAR", + "nullable": true + }, + "c_nationkey": { + "name": "c_nationkey", + "scalarType": "INTEGER", + "nullable": true + }, + "c_mktsegment": { + "name": "c_mktsegment", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "supplier": { + "physicalCatalog": "samples", + "physicalSchema": "tpch", + "catalog": "", + "schema": "TEST", + "name": "supplier", + "columns": { + "s_nationkey": { + "name": "s_nationkey", + "scalarType": "INTEGER", + "nullable": true + }, + "s_name": { + "name": "s_name", + "scalarType": "VARCHAR", + "nullable": true + }, + "s_phone": { + "name": "s_phone", + "scalarType": "VARCHAR", + "nullable": true + }, + "s_suppkey": { + "name": "s_suppkey", + "scalarType": "INTEGER", + "nullable": true + }, + "s_address": { + "name": "s_address", + "scalarType": "VARCHAR", + "nullable": true + }, + "s_comment": { + "name": "s_comment", + "scalarType": "VARCHAR", + "nullable": true + }, + "s_acctbal": { + "name": "s_acctbal", + "scalarType": "FLOAT", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "orders": { + "physicalCatalog": "samples", + "physicalSchema": "tpch", + "catalog": "", + "schema": "TEST", + "name": "orders", + "columns": { + "o_orderdate": { + "name": "o_orderdate", + "scalarType": "DATE", + "nullable": true + }, + "o_shippriority": { + "name": "o_shippriority", + "scalarType": "INTEGER", + "nullable": true + }, + "o_orderstatus": { + "name": "o_orderstatus", + "scalarType": "VARCHAR", + "nullable": true + }, + "o_custkey": { + "name": "o_custkey", + "scalarType": "INTEGER", + "nullable": true + }, + "o_clerk": { + "name": "o_clerk", + "scalarType": "VARCHAR", + "nullable": true + }, + "o_orderkey": { + "name": "o_orderkey", + "scalarType": "INTEGER", + "nullable": true + }, + "o_comment": { + "name": "o_comment", + "scalarType": "VARCHAR", + "nullable": true + }, + "o_orderpriority": { + "name": "o_orderpriority", + "scalarType": "VARCHAR", + "nullable": true + }, + "o_totalprice": { + "name": "o_totalprice", + "scalarType": "FLOAT", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "partsupp": { + "physicalCatalog": "samples", + "physicalSchema": "tpch", + "catalog": "", + "schema": "TEST", + "name": "partsupp", + "columns": { + "ps_availqty": { + "name": "ps_availqty", + "scalarType": "INTEGER", + "nullable": true + }, + "ps_partkey": { + "name": "ps_partkey", + "scalarType": "INTEGER", + "nullable": true + }, + "ps_comment": { + "name": "ps_comment", + "scalarType": "VARCHAR", + "nullable": true + }, + "ps_suppkey": { + "name": "ps_suppkey", + "scalarType": "INTEGER", + "nullable": true + }, + "ps_supplycost": { + "name": "ps_supplycost", + "scalarType": "FLOAT", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + } + } } \ No newline at end of file diff --git a/adapters/databricks/dev.local.configuration.json b/adapters/databricks/dev.local.configuration.json deleted file mode 100644 index ec8dd05..0000000 --- a/adapters/databricks/dev.local.configuration.json +++ /dev/null @@ -1,418 +0,0 @@ -{ - "version": "5", - "$schema": "schema.json", - "model": { - "version": "1.0", - "defaultSchema": "TEST", - "schemas": [ - { - "type": "jdbc", - "name": "TEST", - "sqlDialectFactory": null, - "jdbcUser": null, - "jdbcPassword": null, - "jdbcUrl": "jdbc:databricks://dbc-35019fa9-14d3.cloud.databricks.com:443/;HttpPath=/sql/1.0/warehouses/fd7249aff7e8684c;PWD=dapice663dc29531c32040053109eabdd24f;ConnCatalog=samples;ConnSchema=tpch", - "jdbcCatalog": "samples", - "jdbcSchema": "tpch", - "factory": null - } - ] - }, - "model_file_path": "./model.json", - "fixes": true, - "metadata": { - "region": { - "physicalCatalog": "samples", - "physicalSchema": "tpch", - "catalog": "", - "schema": "TEST", - "name": "region", - "columns": { - "r_name": { - "name": "r_name", - "scalarType": "VARCHAR", - "nullable": true - }, - "r_comment": { - "name": "r_comment", - "scalarType": "VARCHAR", - "nullable": true - }, - "r_regionkey": { - "name": "r_regionkey", - "scalarType": "INTEGER", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "lineitem": { - "physicalCatalog": "samples", - "physicalSchema": "tpch", - "catalog": "", - "schema": "TEST", - "name": "lineitem", - "columns": { - "l_orderkey": { - "name": "l_orderkey", - "scalarType": "INTEGER", - "nullable": true - }, - "l_tax": { - "name": "l_tax", - "scalarType": "FLOAT", - "nullable": true - }, - "l_linestatus": { - "name": "l_linestatus", - "scalarType": "VARCHAR", - "nullable": true - }, - "l_suppkey": { - "name": "l_suppkey", - "scalarType": "INTEGER", - "nullable": true - }, - "l_extendedprice": { - "name": "l_extendedprice", - "scalarType": "FLOAT", - "nullable": true - }, - "l_discount": { - "name": "l_discount", - "scalarType": "FLOAT", - "nullable": true - }, - "l_quantity": { - "name": "l_quantity", - "scalarType": "FLOAT", - "nullable": true - }, - "l_partkey": { - "name": "l_partkey", - "scalarType": "INTEGER", - "nullable": true - }, - "l_receiptdate": { - "name": "l_receiptdate", - "scalarType": "DATE", - "nullable": true - }, - "l_shipmode": { - "name": "l_shipmode", - "scalarType": "VARCHAR", - "nullable": true - }, - "l_returnflag": { - "name": "l_returnflag", - "scalarType": "VARCHAR", - "nullable": true - }, - "l_commitdate": { - "name": "l_commitdate", - "scalarType": "DATE", - "nullable": true - }, - "l_shipdate": { - "name": "l_shipdate", - "scalarType": "DATE", - "nullable": true - }, - "l_linenumber": { - "name": "l_linenumber", - "scalarType": "INTEGER", - "nullable": true - }, - "l_comment": { - "name": "l_comment", - "scalarType": "VARCHAR", - "nullable": true - }, - "l_shipinstruct": { - "name": "l_shipinstruct", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "part": { - "physicalCatalog": "samples", - "physicalSchema": "tpch", - "catalog": "", - "schema": "TEST", - "name": "part", - "columns": { - "p_type": { - "name": "p_type", - "scalarType": "VARCHAR", - "nullable": true - }, - "p_mfgr": { - "name": "p_mfgr", - "scalarType": "VARCHAR", - "nullable": true - }, - "p_partkey": { - "name": "p_partkey", - "scalarType": "INTEGER", - "nullable": true - }, - "p_comment": { - "name": "p_comment", - "scalarType": "VARCHAR", - "nullable": true - }, - "p_retailprice": { - "name": "p_retailprice", - "scalarType": "FLOAT", - "nullable": true - }, - "p_container": { - "name": "p_container", - "scalarType": "VARCHAR", - "nullable": true - }, - "p_name": { - "name": "p_name", - "scalarType": "VARCHAR", - "nullable": true - }, - "p_size": { - "name": "p_size", - "scalarType": "INTEGER", - "nullable": true - }, - "p_brand": { - "name": "p_brand", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "nation": { - "physicalCatalog": "samples", - "physicalSchema": "tpch", - "catalog": "", - "schema": "TEST", - "name": "nation", - "columns": { - "n_name": { - "name": "n_name", - "scalarType": "VARCHAR", - "nullable": true - }, - "n_regionkey": { - "name": "n_regionkey", - "scalarType": "INTEGER", - "nullable": true - }, - "n_comment": { - "name": "n_comment", - "scalarType": "VARCHAR", - "nullable": true - }, - "n_nationkey": { - "name": "n_nationkey", - "scalarType": "INTEGER", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "customer": { - "physicalCatalog": "samples", - "physicalSchema": "tpch", - "catalog": "", - "schema": "TEST", - "name": "customer", - "columns": { - "c_acctbal": { - "name": "c_acctbal", - "scalarType": "FLOAT", - "nullable": true - }, - "c_comment": { - "name": "c_comment", - "scalarType": "VARCHAR", - "nullable": true - }, - "c_phone": { - "name": "c_phone", - "scalarType": "VARCHAR", - "nullable": true - }, - "c_custkey": { - "name": "c_custkey", - "scalarType": "INTEGER", - "nullable": true - }, - "c_address": { - "name": "c_address", - "scalarType": "VARCHAR", - "nullable": true - }, - "c_name": { - "name": "c_name", - "scalarType": "VARCHAR", - "nullable": true - }, - "c_nationkey": { - "name": "c_nationkey", - "scalarType": "INTEGER", - "nullable": true - }, - "c_mktsegment": { - "name": "c_mktsegment", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "supplier": { - "physicalCatalog": "samples", - "physicalSchema": "tpch", - "catalog": "", - "schema": "TEST", - "name": "supplier", - "columns": { - "s_nationkey": { - "name": "s_nationkey", - "scalarType": "INTEGER", - "nullable": true - }, - "s_name": { - "name": "s_name", - "scalarType": "VARCHAR", - "nullable": true - }, - "s_phone": { - "name": "s_phone", - "scalarType": "VARCHAR", - "nullable": true - }, - "s_suppkey": { - "name": "s_suppkey", - "scalarType": "INTEGER", - "nullable": true - }, - "s_address": { - "name": "s_address", - "scalarType": "VARCHAR", - "nullable": true - }, - "s_comment": { - "name": "s_comment", - "scalarType": "VARCHAR", - "nullable": true - }, - "s_acctbal": { - "name": "s_acctbal", - "scalarType": "FLOAT", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "orders": { - "physicalCatalog": "samples", - "physicalSchema": "tpch", - "catalog": "", - "schema": "TEST", - "name": "orders", - "columns": { - "o_orderdate": { - "name": "o_orderdate", - "scalarType": "DATE", - "nullable": true - }, - "o_shippriority": { - "name": "o_shippriority", - "scalarType": "INTEGER", - "nullable": true - }, - "o_orderstatus": { - "name": "o_orderstatus", - "scalarType": "VARCHAR", - "nullable": true - }, - "o_custkey": { - "name": "o_custkey", - "scalarType": "INTEGER", - "nullable": true - }, - "o_clerk": { - "name": "o_clerk", - "scalarType": "VARCHAR", - "nullable": true - }, - "o_orderkey": { - "name": "o_orderkey", - "scalarType": "INTEGER", - "nullable": true - }, - "o_comment": { - "name": "o_comment", - "scalarType": "VARCHAR", - "nullable": true - }, - "o_orderpriority": { - "name": "o_orderpriority", - "scalarType": "VARCHAR", - "nullable": true - }, - "o_totalprice": { - "name": "o_totalprice", - "scalarType": "FLOAT", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "partsupp": { - "physicalCatalog": "samples", - "physicalSchema": "tpch", - "catalog": "", - "schema": "TEST", - "name": "partsupp", - "columns": { - "ps_availqty": { - "name": "ps_availqty", - "scalarType": "INTEGER", - "nullable": true - }, - "ps_partkey": { - "name": "ps_partkey", - "scalarType": "INTEGER", - "nullable": true - }, - "ps_comment": { - "name": "ps_comment", - "scalarType": "VARCHAR", - "nullable": true - }, - "ps_suppkey": { - "name": "ps_suppkey", - "scalarType": "INTEGER", - "nullable": true - }, - "ps_supplycost": { - "name": "ps_supplycost", - "scalarType": "FLOAT", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - } - } -} \ No newline at end of file diff --git a/adapters/databricks/model.json b/adapters/databricks/model.json index c3755bf..68cd0e8 100644 --- a/adapters/databricks/model.json +++ b/adapters/databricks/model.json @@ -6,11 +6,9 @@ "name": "TEST", "type": "jdbc", "jdbcDriver": "com.databricks.client.jdbc.Driver", - "jdbcUrl": "jdbc:databricks://dbc-35019fa9-14d3.cloud.databricks.com:443/;HttpPath=/sql/1.0/warehouses/fd7249aff7e8684c;PWD=;ConnCatalog=samples;ConnSchema=tpch", - "jdbcSchema": "tpch", - "jdbcCatalog": "samples", - "jdbcUser": null, - "jdbcPassword": null + "jdbcUrl": "${DATABRICKS_JDBC_URL}", + "jdbcSchema": "workspace", + "jdbcCatalog": "chinook" } ] } diff --git a/adapters/db2/dev.local.configuration.json b/adapters/db2/configuration.json similarity index 100% rename from adapters/db2/dev.local.configuration.json rename to adapters/db2/configuration.json diff --git a/adapters/file/configuration.json b/adapters/file/configuration.json index 45c1cbb..c9dac13 100644 --- a/adapters/file/configuration.json +++ b/adapters/file/configuration.json @@ -1,6 +1,463 @@ { "version": "5", "$schema": "schema.json", + "model": { + "version": "1.0", + "defaultSchema": "default", + "schemas": [ + { + "type": "custom", + "name": "default", + "sqlDialectFactory": null, + "jdbcUser": null, + "jdbcPassword": null, + "jdbcUrl": null, + "jdbcCatalog": null, + "jdbcSchema": null, + "factory": "org.apache.calcite.adapter.file.FileSchemaFactory", + "operand": { + "directory": "/Users/kennethstott/Documents/GitHub/calcite-connector/adapters/file/data/files" + } + } + ] + }, "model_file_path": "./model.json", - "fixes": true + "fixes": true, + "metadata": { + "2022CbpOceanEconomyTable__Notes": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "2022CbpOceanEconomyTable__Notes", + "columns": { + "County Business Patterns (CBP) Ocean Economy Table: 2022": { + "name": "County Business Patterns (CBP) Ocean Economy Table: 2022", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "EMPS": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "EMPS", + "columns": { + "EMPNO": { + "name": "EMPNO", + "scalarType": "INTEGER", + "nullable": true + }, + "NAME": { + "name": "NAME", + "scalarType": "VARCHAR", + "nullable": true + }, + "GENDER": { + "name": "GENDER", + "scalarType": "VARCHAR", + "nullable": true + }, + "SLACKER": { + "name": "SLACKER", + "scalarType": "BOOLEAN", + "nullable": true + }, + "MANAGER": { + "name": "MANAGER", + "scalarType": "BOOLEAN", + "nullable": true + }, + "DEPTNO": { + "name": "DEPTNO", + "scalarType": "INTEGER", + "nullable": true + }, + "AGE": { + "name": "AGE", + "scalarType": "INTEGER", + "nullable": true + }, + "JOINEDAT": { + "name": "JOINEDAT", + "scalarType": "DATE", + "nullable": true + }, + "EMPID": { + "name": "EMPID", + "scalarType": "INTEGER", + "nullable": true + }, + "CITY": { + "name": "CITY", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "WACKY_COLUMN_NAMES": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "WACKY_COLUMN_NAMES", + "columns": { + "DEPTNO": { + "name": "DEPTNO", + "scalarType": "INTEGER", + "nullable": true + }, + "AGE": { + "name": "AGE", + "scalarType": "INTEGER", + "nullable": true + }, + "joined at": { + "name": "joined at", + "scalarType": "DATE", + "nullable": true + }, + "EMPNO": { + "name": "EMPNO", + "scalarType": "INTEGER", + "nullable": true + }, + "2gender": { + "name": "2gender", + "scalarType": "VARCHAR", + "nullable": true + }, + "naME": { + "name": "naME", + "scalarType": "VARCHAR", + "nullable": true + }, + "MANAGER": { + "name": "MANAGER", + "scalarType": "BOOLEAN", + "nullable": true + }, + "CITY": { + "name": "CITY", + "scalarType": "VARCHAR", + "nullable": true + }, + "SLACKER": { + "name": "SLACKER", + "scalarType": "BOOLEAN", + "nullable": true + }, + "EMPID": { + "name": "EMPID", + "scalarType": "INTEGER", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "ARCHERS": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "ARCHERS", + "columns": { + "g": { + "name": "g", + "scalarType": "LIST", + "nullable": true + }, + "object": { + "name": "object", + "scalarType": "MAP", + "nullable": true + }, + "d": { + "name": "d", + "scalarType": "LIST", + "nullable": true + }, + "b": { + "name": "b", + "scalarType": "VARCHAR", + "nullable": true + }, + "id": { + "name": "id", + "scalarType": "INTEGER", + "nullable": true + }, + "a": { + "name": "a", + "scalarType": "VARCHAR", + "nullable": true + }, + "f": { + "name": "f", + "scalarType": "VARCHAR", + "nullable": true + }, + "e": { + "name": "e", + "scalarType": "VARCHAR", + "nullable": true + }, + "c": { + "name": "c", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "DEPTS": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "DEPTS", + "columns": { + "DEPTNO": { + "name": "DEPTNO", + "scalarType": "INTEGER", + "nullable": true + }, + "NAME": { + "name": "NAME", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "yaml": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "yaml", + "columns": { + "g": { + "name": "g", + "scalarType": "LIST", + "nullable": true + }, + "e": { + "name": "e", + "scalarType": "VARCHAR", + "nullable": true + }, + "a": { + "name": "a", + "scalarType": "VARCHAR", + "nullable": true + }, + "c": { + "name": "c", + "scalarType": "VARCHAR", + "nullable": true + }, + "b": { + "name": "b", + "scalarType": "VARCHAR", + "nullable": true + }, + "f": { + "name": "f", + "scalarType": "VARCHAR", + "nullable": true + }, + "d": { + "name": "d", + "scalarType": "LIST", + "nullable": true + }, + "id": { + "name": "id", + "scalarType": "INTEGER", + "nullable": true + }, + "object": { + "name": "object", + "scalarType": "MAP", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "SDEPTS": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "SDEPTS", + "columns": { + "NAME": { + "name": "NAME", + "scalarType": "VARCHAR", + "nullable": true + }, + "DEPTNO": { + "name": "DEPTNO", + "scalarType": "INTEGER", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "2022CbpOceanEconomyTable__2022CbpIaOceanEconomy": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "2022CbpOceanEconomyTable__2022CbpIaOceanEconomy", + "columns": { + "2022 CBP Island Areas Ocean Economy Tabulation": { + "name": "2022 CBP Island Areas Ocean Economy Tabulation", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "DATES": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "DATES", + "columns": { + "EMPNO": { + "name": "EMPNO", + "scalarType": "INTEGER", + "nullable": true + }, + "JOINTIME": { + "name": "JOINTIME", + "scalarType": "VARCHAR", + "nullable": true + }, + "JOINTIMES": { + "name": "JOINTIMES", + "scalarType": "TIMESTAMP", + "nullable": true + }, + "JOINEDAT": { + "name": "JOINEDAT", + "scalarType": "DATE", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "LONG_EMPS": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "LONG_EMPS", + "columns": { + "MANAGER": { + "name": "MANAGER", + "scalarType": "BOOLEAN", + "nullable": true + }, + "GENDER": { + "name": "GENDER", + "scalarType": "VARCHAR", + "nullable": true + }, + "EMPNO": { + "name": "EMPNO", + "scalarType": "INTEGER", + "nullable": true + }, + "JOINEDAT": { + "name": "JOINEDAT", + "scalarType": "DATE", + "nullable": true + }, + "DEPTNO": { + "name": "DEPTNO", + "scalarType": "INTEGER", + "nullable": true + }, + "AGE": { + "name": "AGE", + "scalarType": "INTEGER", + "nullable": true + }, + "SLACKER": { + "name": "SLACKER", + "scalarType": "BOOLEAN", + "nullable": true + }, + "NAME": { + "name": "NAME", + "scalarType": "VARCHAR", + "nullable": true + }, + "EMPID": { + "name": "EMPID", + "scalarType": "INTEGER", + "nullable": true + }, + "CITY": { + "name": "CITY", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [], + "exportedKeys": [] + }, + "Connections_2": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "Connections_2", + "columns": { + "Company": { + "name": "Company", + "scalarType": "VARCHAR", + "nullable": false + }, + "Last Name": { + "name": "Last Name", + "scalarType": "VARCHAR", + "nullable": false + }, + "Email Address": { + "name": "Email Address", + "scalarType": "VARCHAR", + "nullable": false + }, + "Position": { + "name": "Position", + "scalarType": "VARCHAR", + "nullable": false + }, + "Connected On": { + "name": "Connected On", + "scalarType": "VARCHAR", + "nullable": false + }, + "URL": { + "name": "URL", + "scalarType": "VARCHAR", + "nullable": false + }, + "First Name": { + "name": "First Name", + "scalarType": "VARCHAR", + "nullable": false + } + }, + "primaryKeys": [], + "exportedKeys": [] + } + } } \ No newline at end of file diff --git a/adapters/file/dev.local.configuration.json b/adapters/file/dev.local.configuration.json deleted file mode 100644 index c9dac13..0000000 --- a/adapters/file/dev.local.configuration.json +++ /dev/null @@ -1,463 +0,0 @@ -{ - "version": "5", - "$schema": "schema.json", - "model": { - "version": "1.0", - "defaultSchema": "default", - "schemas": [ - { - "type": "custom", - "name": "default", - "sqlDialectFactory": null, - "jdbcUser": null, - "jdbcPassword": null, - "jdbcUrl": null, - "jdbcCatalog": null, - "jdbcSchema": null, - "factory": "org.apache.calcite.adapter.file.FileSchemaFactory", - "operand": { - "directory": "/Users/kennethstott/Documents/GitHub/calcite-connector/adapters/file/data/files" - } - } - ] - }, - "model_file_path": "./model.json", - "fixes": true, - "metadata": { - "2022CbpOceanEconomyTable__Notes": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "2022CbpOceanEconomyTable__Notes", - "columns": { - "County Business Patterns (CBP) Ocean Economy Table: 2022": { - "name": "County Business Patterns (CBP) Ocean Economy Table: 2022", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "EMPS": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "EMPS", - "columns": { - "EMPNO": { - "name": "EMPNO", - "scalarType": "INTEGER", - "nullable": true - }, - "NAME": { - "name": "NAME", - "scalarType": "VARCHAR", - "nullable": true - }, - "GENDER": { - "name": "GENDER", - "scalarType": "VARCHAR", - "nullable": true - }, - "SLACKER": { - "name": "SLACKER", - "scalarType": "BOOLEAN", - "nullable": true - }, - "MANAGER": { - "name": "MANAGER", - "scalarType": "BOOLEAN", - "nullable": true - }, - "DEPTNO": { - "name": "DEPTNO", - "scalarType": "INTEGER", - "nullable": true - }, - "AGE": { - "name": "AGE", - "scalarType": "INTEGER", - "nullable": true - }, - "JOINEDAT": { - "name": "JOINEDAT", - "scalarType": "DATE", - "nullable": true - }, - "EMPID": { - "name": "EMPID", - "scalarType": "INTEGER", - "nullable": true - }, - "CITY": { - "name": "CITY", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "WACKY_COLUMN_NAMES": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "WACKY_COLUMN_NAMES", - "columns": { - "DEPTNO": { - "name": "DEPTNO", - "scalarType": "INTEGER", - "nullable": true - }, - "AGE": { - "name": "AGE", - "scalarType": "INTEGER", - "nullable": true - }, - "joined at": { - "name": "joined at", - "scalarType": "DATE", - "nullable": true - }, - "EMPNO": { - "name": "EMPNO", - "scalarType": "INTEGER", - "nullable": true - }, - "2gender": { - "name": "2gender", - "scalarType": "VARCHAR", - "nullable": true - }, - "naME": { - "name": "naME", - "scalarType": "VARCHAR", - "nullable": true - }, - "MANAGER": { - "name": "MANAGER", - "scalarType": "BOOLEAN", - "nullable": true - }, - "CITY": { - "name": "CITY", - "scalarType": "VARCHAR", - "nullable": true - }, - "SLACKER": { - "name": "SLACKER", - "scalarType": "BOOLEAN", - "nullable": true - }, - "EMPID": { - "name": "EMPID", - "scalarType": "INTEGER", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "ARCHERS": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "ARCHERS", - "columns": { - "g": { - "name": "g", - "scalarType": "LIST", - "nullable": true - }, - "object": { - "name": "object", - "scalarType": "MAP", - "nullable": true - }, - "d": { - "name": "d", - "scalarType": "LIST", - "nullable": true - }, - "b": { - "name": "b", - "scalarType": "VARCHAR", - "nullable": true - }, - "id": { - "name": "id", - "scalarType": "INTEGER", - "nullable": true - }, - "a": { - "name": "a", - "scalarType": "VARCHAR", - "nullable": true - }, - "f": { - "name": "f", - "scalarType": "VARCHAR", - "nullable": true - }, - "e": { - "name": "e", - "scalarType": "VARCHAR", - "nullable": true - }, - "c": { - "name": "c", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "DEPTS": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "DEPTS", - "columns": { - "DEPTNO": { - "name": "DEPTNO", - "scalarType": "INTEGER", - "nullable": true - }, - "NAME": { - "name": "NAME", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "yaml": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "yaml", - "columns": { - "g": { - "name": "g", - "scalarType": "LIST", - "nullable": true - }, - "e": { - "name": "e", - "scalarType": "VARCHAR", - "nullable": true - }, - "a": { - "name": "a", - "scalarType": "VARCHAR", - "nullable": true - }, - "c": { - "name": "c", - "scalarType": "VARCHAR", - "nullable": true - }, - "b": { - "name": "b", - "scalarType": "VARCHAR", - "nullable": true - }, - "f": { - "name": "f", - "scalarType": "VARCHAR", - "nullable": true - }, - "d": { - "name": "d", - "scalarType": "LIST", - "nullable": true - }, - "id": { - "name": "id", - "scalarType": "INTEGER", - "nullable": true - }, - "object": { - "name": "object", - "scalarType": "MAP", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "SDEPTS": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "SDEPTS", - "columns": { - "NAME": { - "name": "NAME", - "scalarType": "VARCHAR", - "nullable": true - }, - "DEPTNO": { - "name": "DEPTNO", - "scalarType": "INTEGER", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "2022CbpOceanEconomyTable__2022CbpIaOceanEconomy": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "2022CbpOceanEconomyTable__2022CbpIaOceanEconomy", - "columns": { - "2022 CBP Island Areas Ocean Economy Tabulation": { - "name": "2022 CBP Island Areas Ocean Economy Tabulation", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "DATES": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "DATES", - "columns": { - "EMPNO": { - "name": "EMPNO", - "scalarType": "INTEGER", - "nullable": true - }, - "JOINTIME": { - "name": "JOINTIME", - "scalarType": "VARCHAR", - "nullable": true - }, - "JOINTIMES": { - "name": "JOINTIMES", - "scalarType": "TIMESTAMP", - "nullable": true - }, - "JOINEDAT": { - "name": "JOINEDAT", - "scalarType": "DATE", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "LONG_EMPS": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "LONG_EMPS", - "columns": { - "MANAGER": { - "name": "MANAGER", - "scalarType": "BOOLEAN", - "nullable": true - }, - "GENDER": { - "name": "GENDER", - "scalarType": "VARCHAR", - "nullable": true - }, - "EMPNO": { - "name": "EMPNO", - "scalarType": "INTEGER", - "nullable": true - }, - "JOINEDAT": { - "name": "JOINEDAT", - "scalarType": "DATE", - "nullable": true - }, - "DEPTNO": { - "name": "DEPTNO", - "scalarType": "INTEGER", - "nullable": true - }, - "AGE": { - "name": "AGE", - "scalarType": "INTEGER", - "nullable": true - }, - "SLACKER": { - "name": "SLACKER", - "scalarType": "BOOLEAN", - "nullable": true - }, - "NAME": { - "name": "NAME", - "scalarType": "VARCHAR", - "nullable": true - }, - "EMPID": { - "name": "EMPID", - "scalarType": "INTEGER", - "nullable": true - }, - "CITY": { - "name": "CITY", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [], - "exportedKeys": [] - }, - "Connections_2": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "Connections_2", - "columns": { - "Company": { - "name": "Company", - "scalarType": "VARCHAR", - "nullable": false - }, - "Last Name": { - "name": "Last Name", - "scalarType": "VARCHAR", - "nullable": false - }, - "Email Address": { - "name": "Email Address", - "scalarType": "VARCHAR", - "nullable": false - }, - "Position": { - "name": "Position", - "scalarType": "VARCHAR", - "nullable": false - }, - "Connected On": { - "name": "Connected On", - "scalarType": "VARCHAR", - "nullable": false - }, - "URL": { - "name": "URL", - "scalarType": "VARCHAR", - "nullable": false - }, - "First Name": { - "name": "First Name", - "scalarType": "VARCHAR", - "nullable": false - } - }, - "primaryKeys": [], - "exportedKeys": [] - } - } -} \ No newline at end of file diff --git a/adapters/h2/dev.local.configuration.json b/adapters/h2/configuration.json similarity index 100% rename from adapters/h2/dev.local.configuration.json rename to adapters/h2/configuration.json diff --git a/adapters/hive/dev.local.configuration.json b/adapters/hive/configuration.json similarity index 100% rename from adapters/hive/dev.local.configuration.json rename to adapters/hive/configuration.json diff --git a/adapters/jdbc/configuration.json b/adapters/jdbc/configuration.json index 3238bd6..4586366 100644 --- a/adapters/jdbc/configuration.json +++ b/adapters/jdbc/configuration.json @@ -1,7 +1,598 @@ { "version": "5", "$schema": "schema.json", + "model": { + "version": "1.0", + "defaultSchema": "default", + "schemas": [ + { + "type": "jdbc", + "name": "default", + "cache": true, + "sqlDialectFactory": "com.hasura.SQLiteSqlDialectFactory", + "jdbcUser": null, + "jdbcPassword": null, + "jdbcUrl": "jdbc:sqlite:/Users/kennethstott/Documents/GitHub/calcite-connector/adapters/jdbc/chinook.db", + "jdbcCatalog": null, + "jdbcSchema": null, + "factory": null + } + ] + }, "model_file_path": "./model.json", "fixes": true, - "supportJsonObject": true + "metadata": { + "tracks": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "tracks", + "columns": { + "Bytes": { + "name": "Bytes", + "scalarType": "INTEGER", + "nullable": true + }, + "Name": { + "name": "Name", + "scalarType": "VARCHAR", + "nullable": false + }, + "GenreId": { + "name": "GenreId", + "scalarType": "INTEGER", + "nullable": true + }, + "MediaTypeId": { + "name": "MediaTypeId", + "scalarType": "INTEGER", + "nullable": false + }, + "UnitPrice": { + "name": "UnitPrice", + "scalarType": "FLOAT", + "nullable": false + }, + "AlbumId": { + "name": "AlbumId", + "scalarType": "INTEGER", + "nullable": true + }, + "Milliseconds": { + "name": "Milliseconds", + "scalarType": "INTEGER", + "nullable": false + }, + "Composer": { + "name": "Composer", + "scalarType": "VARCHAR", + "nullable": true + }, + "TrackId": { + "name": "TrackId", + "scalarType": "INTEGER", + "nullable": false + } + }, + "primaryKeys": [ + "TrackId" + ], + "exportedKeys": [ + { + "pkTableSchema": "default", + "pkTableName": "tracks", + "pkColumnName": "TrackId", + "pkName": "", + "fkTableSchema": "default", + "fkTableName": "invoice_items", + "fkColumnName": "TrackId", + "fkName": "" + }, + { + "pkTableSchema": "default", + "pkTableName": "tracks", + "pkColumnName": "TrackId", + "pkName": "", + "fkTableSchema": "default", + "fkTableName": "playlist_track", + "fkColumnName": "TrackId", + "fkName": "" + } + ] + }, + "albums": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "albums", + "columns": { + "AlbumId": { + "name": "AlbumId", + "scalarType": "INTEGER", + "nullable": false + }, + "Title": { + "name": "Title", + "scalarType": "VARCHAR", + "nullable": false + }, + "ArtistId": { + "name": "ArtistId", + "scalarType": "INTEGER", + "nullable": false + } + }, + "primaryKeys": [ + "AlbumId" + ], + "exportedKeys": [ + { + "pkTableSchema": "default", + "pkTableName": "albums", + "pkColumnName": "AlbumId", + "pkName": "", + "fkTableSchema": "default", + "fkTableName": "tracks", + "fkColumnName": "AlbumId", + "fkName": "" + } + ] + }, + "artists": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "artists", + "columns": { + "Name": { + "name": "Name", + "scalarType": "VARCHAR", + "nullable": true + }, + "ArtistId": { + "name": "ArtistId", + "scalarType": "INTEGER", + "nullable": false + } + }, + "primaryKeys": [ + "ArtistId" + ], + "exportedKeys": [ + { + "pkTableSchema": "default", + "pkTableName": "artists", + "pkColumnName": "ArtistId", + "pkName": "", + "fkTableSchema": "default", + "fkTableName": "albums", + "fkColumnName": "ArtistId", + "fkName": "" + } + ] + }, + "genres": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "genres", + "columns": { + "GenreId": { + "name": "GenreId", + "scalarType": "INTEGER", + "nullable": false + }, + "Name": { + "name": "Name", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [ + "GenreId" + ], + "exportedKeys": [ + { + "pkTableSchema": "default", + "pkTableName": "genres", + "pkColumnName": "GenreId", + "pkName": "", + "fkTableSchema": "default", + "fkTableName": "tracks", + "fkColumnName": "GenreId", + "fkName": "" + } + ] + }, + "invoices": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "invoices", + "columns": { + "BillingAddress": { + "name": "BillingAddress", + "scalarType": "VARCHAR", + "nullable": true + }, + "BillingPostalCode": { + "name": "BillingPostalCode", + "scalarType": "VARCHAR", + "nullable": true + }, + "BillingState": { + "name": "BillingState", + "scalarType": "VARCHAR", + "nullable": true + }, + "CustomerId": { + "name": "CustomerId", + "scalarType": "INTEGER", + "nullable": false + }, + "BillingCity": { + "name": "BillingCity", + "scalarType": "VARCHAR", + "nullable": true + }, + "Total": { + "name": "Total", + "scalarType": "FLOAT", + "nullable": false + }, + "InvoiceDate": { + "name": "InvoiceDate", + "scalarType": "TIMESTAMP", + "nullable": false + }, + "InvoiceId": { + "name": "InvoiceId", + "scalarType": "INTEGER", + "nullable": false + }, + "BillingCountry": { + "name": "BillingCountry", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [ + "InvoiceId" + ], + "exportedKeys": [ + { + "pkTableSchema": "default", + "pkTableName": "invoices", + "pkColumnName": "InvoiceId", + "pkName": "", + "fkTableSchema": "default", + "fkTableName": "invoice_items", + "fkColumnName": "InvoiceId", + "fkName": "" + } + ] + }, + "customers": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "customers", + "columns": { + "CustomerId": { + "name": "CustomerId", + "scalarType": "INTEGER", + "nullable": false + }, + "State": { + "name": "State", + "scalarType": "VARCHAR", + "nullable": true + }, + "Phone": { + "name": "Phone", + "scalarType": "VARCHAR", + "nullable": true + }, + "Address": { + "name": "Address", + "scalarType": "VARCHAR", + "nullable": true + }, + "Email": { + "name": "Email", + "scalarType": "VARCHAR", + "nullable": false + }, + "LastName": { + "name": "LastName", + "scalarType": "VARCHAR", + "nullable": false + }, + "City": { + "name": "City", + "scalarType": "VARCHAR", + "nullable": true + }, + "FirstName": { + "name": "FirstName", + "scalarType": "VARCHAR", + "nullable": false + }, + "Fax": { + "name": "Fax", + "scalarType": "VARCHAR", + "nullable": true + }, + "SupportRepId": { + "name": "SupportRepId", + "scalarType": "INTEGER", + "nullable": true + }, + "Company": { + "name": "Company", + "scalarType": "VARCHAR", + "nullable": true + }, + "Country": { + "name": "Country", + "scalarType": "VARCHAR", + "nullable": true + }, + "PostalCode": { + "name": "PostalCode", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [ + "CustomerId" + ], + "exportedKeys": [ + { + "pkTableSchema": "default", + "pkTableName": "customers", + "pkColumnName": "CustomerId", + "pkName": "", + "fkTableSchema": "default", + "fkTableName": "invoices", + "fkColumnName": "CustomerId", + "fkName": "" + } + ] + }, + "invoice_items": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "invoice_items", + "columns": { + "InvoiceId": { + "name": "InvoiceId", + "scalarType": "INTEGER", + "nullable": false + }, + "TrackId": { + "name": "TrackId", + "scalarType": "INTEGER", + "nullable": false + }, + "InvoiceLineId": { + "name": "InvoiceLineId", + "scalarType": "INTEGER", + "nullable": false + }, + "UnitPrice": { + "name": "UnitPrice", + "scalarType": "FLOAT", + "nullable": false + }, + "Quantity": { + "name": "Quantity", + "scalarType": "INTEGER", + "nullable": false + } + }, + "primaryKeys": [ + "InvoiceLineId" + ], + "exportedKeys": [] + }, + "playlists": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "playlists", + "columns": { + "Name": { + "name": "Name", + "scalarType": "VARCHAR", + "nullable": true + }, + "PlaylistId": { + "name": "PlaylistId", + "scalarType": "INTEGER", + "nullable": false + } + }, + "primaryKeys": [ + "PlaylistId" + ], + "exportedKeys": [ + { + "pkTableSchema": "default", + "pkTableName": "playlists", + "pkColumnName": "PlaylistId", + "pkName": "", + "fkTableSchema": "default", + "fkTableName": "playlist_track", + "fkColumnName": "PlaylistId", + "fkName": "" + } + ] + }, + "playlist_track": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "playlist_track", + "columns": { + "PlaylistId": { + "name": "PlaylistId", + "scalarType": "INTEGER", + "nullable": false + }, + "TrackId": { + "name": "TrackId", + "scalarType": "INTEGER", + "nullable": false + } + }, + "primaryKeys": [ + "PlaylistId", + "TrackId" + ], + "exportedKeys": [] + }, + "media_types": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "media_types", + "columns": { + "MediaTypeId": { + "name": "MediaTypeId", + "scalarType": "INTEGER", + "nullable": false + }, + "Name": { + "name": "Name", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [ + "MediaTypeId" + ], + "exportedKeys": [ + { + "pkTableSchema": "default", + "pkTableName": "media_types", + "pkColumnName": "MediaTypeId", + "pkName": "", + "fkTableSchema": "default", + "fkTableName": "tracks", + "fkColumnName": "MediaTypeId", + "fkName": "" + } + ] + }, + "employees": { + "physicalSchema": "default", + "catalog": "", + "schema": "default", + "name": "employees", + "columns": { + "PostalCode": { + "name": "PostalCode", + "scalarType": "VARCHAR", + "nullable": true + }, + "BirthDate": { + "name": "BirthDate", + "scalarType": "TIMESTAMP", + "nullable": true + }, + "Title": { + "name": "Title", + "scalarType": "VARCHAR", + "nullable": true + }, + "ReportsTo": { + "name": "ReportsTo", + "scalarType": "INTEGER", + "nullable": true + }, + "State": { + "name": "State", + "scalarType": "VARCHAR", + "nullable": true + }, + "HireDate": { + "name": "HireDate", + "scalarType": "TIMESTAMP", + "nullable": true + }, + "EmployeeId": { + "name": "EmployeeId", + "scalarType": "INTEGER", + "nullable": false + }, + "FirstName": { + "name": "FirstName", + "scalarType": "VARCHAR", + "nullable": false + }, + "Email": { + "name": "Email", + "scalarType": "VARCHAR", + "nullable": true + }, + "City": { + "name": "City", + "scalarType": "VARCHAR", + "nullable": true + }, + "Phone": { + "name": "Phone", + "scalarType": "VARCHAR", + "nullable": true + }, + "Fax": { + "name": "Fax", + "scalarType": "VARCHAR", + "nullable": true + }, + "Country": { + "name": "Country", + "scalarType": "VARCHAR", + "nullable": true + }, + "LastName": { + "name": "LastName", + "scalarType": "VARCHAR", + "nullable": false + }, + "Address": { + "name": "Address", + "scalarType": "VARCHAR", + "nullable": true + } + }, + "primaryKeys": [ + "EmployeeId" + ], + "exportedKeys": [ + { + "pkTableSchema": "default", + "pkTableName": "employees", + "pkColumnName": "EmployeeId", + "pkName": "", + "fkTableSchema": "default", + "fkTableName": "customers", + "fkColumnName": "SupportRepId", + "fkName": "" + }, + { + "pkTableSchema": "default", + "pkTableName": "employees", + "pkColumnName": "EmployeeId", + "pkName": "", + "fkTableSchema": "default", + "fkTableName": "employees", + "fkColumnName": "ReportsTo", + "fkName": "" + } + ] + } + } } \ No newline at end of file diff --git a/adapters/jdbc/dev.local.configuration.json b/adapters/jdbc/dev.local.configuration.json deleted file mode 100644 index 4586366..0000000 --- a/adapters/jdbc/dev.local.configuration.json +++ /dev/null @@ -1,598 +0,0 @@ -{ - "version": "5", - "$schema": "schema.json", - "model": { - "version": "1.0", - "defaultSchema": "default", - "schemas": [ - { - "type": "jdbc", - "name": "default", - "cache": true, - "sqlDialectFactory": "com.hasura.SQLiteSqlDialectFactory", - "jdbcUser": null, - "jdbcPassword": null, - "jdbcUrl": "jdbc:sqlite:/Users/kennethstott/Documents/GitHub/calcite-connector/adapters/jdbc/chinook.db", - "jdbcCatalog": null, - "jdbcSchema": null, - "factory": null - } - ] - }, - "model_file_path": "./model.json", - "fixes": true, - "metadata": { - "tracks": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "tracks", - "columns": { - "Bytes": { - "name": "Bytes", - "scalarType": "INTEGER", - "nullable": true - }, - "Name": { - "name": "Name", - "scalarType": "VARCHAR", - "nullable": false - }, - "GenreId": { - "name": "GenreId", - "scalarType": "INTEGER", - "nullable": true - }, - "MediaTypeId": { - "name": "MediaTypeId", - "scalarType": "INTEGER", - "nullable": false - }, - "UnitPrice": { - "name": "UnitPrice", - "scalarType": "FLOAT", - "nullable": false - }, - "AlbumId": { - "name": "AlbumId", - "scalarType": "INTEGER", - "nullable": true - }, - "Milliseconds": { - "name": "Milliseconds", - "scalarType": "INTEGER", - "nullable": false - }, - "Composer": { - "name": "Composer", - "scalarType": "VARCHAR", - "nullable": true - }, - "TrackId": { - "name": "TrackId", - "scalarType": "INTEGER", - "nullable": false - } - }, - "primaryKeys": [ - "TrackId" - ], - "exportedKeys": [ - { - "pkTableSchema": "default", - "pkTableName": "tracks", - "pkColumnName": "TrackId", - "pkName": "", - "fkTableSchema": "default", - "fkTableName": "invoice_items", - "fkColumnName": "TrackId", - "fkName": "" - }, - { - "pkTableSchema": "default", - "pkTableName": "tracks", - "pkColumnName": "TrackId", - "pkName": "", - "fkTableSchema": "default", - "fkTableName": "playlist_track", - "fkColumnName": "TrackId", - "fkName": "" - } - ] - }, - "albums": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "albums", - "columns": { - "AlbumId": { - "name": "AlbumId", - "scalarType": "INTEGER", - "nullable": false - }, - "Title": { - "name": "Title", - "scalarType": "VARCHAR", - "nullable": false - }, - "ArtistId": { - "name": "ArtistId", - "scalarType": "INTEGER", - "nullable": false - } - }, - "primaryKeys": [ - "AlbumId" - ], - "exportedKeys": [ - { - "pkTableSchema": "default", - "pkTableName": "albums", - "pkColumnName": "AlbumId", - "pkName": "", - "fkTableSchema": "default", - "fkTableName": "tracks", - "fkColumnName": "AlbumId", - "fkName": "" - } - ] - }, - "artists": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "artists", - "columns": { - "Name": { - "name": "Name", - "scalarType": "VARCHAR", - "nullable": true - }, - "ArtistId": { - "name": "ArtistId", - "scalarType": "INTEGER", - "nullable": false - } - }, - "primaryKeys": [ - "ArtistId" - ], - "exportedKeys": [ - { - "pkTableSchema": "default", - "pkTableName": "artists", - "pkColumnName": "ArtistId", - "pkName": "", - "fkTableSchema": "default", - "fkTableName": "albums", - "fkColumnName": "ArtistId", - "fkName": "" - } - ] - }, - "genres": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "genres", - "columns": { - "GenreId": { - "name": "GenreId", - "scalarType": "INTEGER", - "nullable": false - }, - "Name": { - "name": "Name", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [ - "GenreId" - ], - "exportedKeys": [ - { - "pkTableSchema": "default", - "pkTableName": "genres", - "pkColumnName": "GenreId", - "pkName": "", - "fkTableSchema": "default", - "fkTableName": "tracks", - "fkColumnName": "GenreId", - "fkName": "" - } - ] - }, - "invoices": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "invoices", - "columns": { - "BillingAddress": { - "name": "BillingAddress", - "scalarType": "VARCHAR", - "nullable": true - }, - "BillingPostalCode": { - "name": "BillingPostalCode", - "scalarType": "VARCHAR", - "nullable": true - }, - "BillingState": { - "name": "BillingState", - "scalarType": "VARCHAR", - "nullable": true - }, - "CustomerId": { - "name": "CustomerId", - "scalarType": "INTEGER", - "nullable": false - }, - "BillingCity": { - "name": "BillingCity", - "scalarType": "VARCHAR", - "nullable": true - }, - "Total": { - "name": "Total", - "scalarType": "FLOAT", - "nullable": false - }, - "InvoiceDate": { - "name": "InvoiceDate", - "scalarType": "TIMESTAMP", - "nullable": false - }, - "InvoiceId": { - "name": "InvoiceId", - "scalarType": "INTEGER", - "nullable": false - }, - "BillingCountry": { - "name": "BillingCountry", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [ - "InvoiceId" - ], - "exportedKeys": [ - { - "pkTableSchema": "default", - "pkTableName": "invoices", - "pkColumnName": "InvoiceId", - "pkName": "", - "fkTableSchema": "default", - "fkTableName": "invoice_items", - "fkColumnName": "InvoiceId", - "fkName": "" - } - ] - }, - "customers": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "customers", - "columns": { - "CustomerId": { - "name": "CustomerId", - "scalarType": "INTEGER", - "nullable": false - }, - "State": { - "name": "State", - "scalarType": "VARCHAR", - "nullable": true - }, - "Phone": { - "name": "Phone", - "scalarType": "VARCHAR", - "nullable": true - }, - "Address": { - "name": "Address", - "scalarType": "VARCHAR", - "nullable": true - }, - "Email": { - "name": "Email", - "scalarType": "VARCHAR", - "nullable": false - }, - "LastName": { - "name": "LastName", - "scalarType": "VARCHAR", - "nullable": false - }, - "City": { - "name": "City", - "scalarType": "VARCHAR", - "nullable": true - }, - "FirstName": { - "name": "FirstName", - "scalarType": "VARCHAR", - "nullable": false - }, - "Fax": { - "name": "Fax", - "scalarType": "VARCHAR", - "nullable": true - }, - "SupportRepId": { - "name": "SupportRepId", - "scalarType": "INTEGER", - "nullable": true - }, - "Company": { - "name": "Company", - "scalarType": "VARCHAR", - "nullable": true - }, - "Country": { - "name": "Country", - "scalarType": "VARCHAR", - "nullable": true - }, - "PostalCode": { - "name": "PostalCode", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [ - "CustomerId" - ], - "exportedKeys": [ - { - "pkTableSchema": "default", - "pkTableName": "customers", - "pkColumnName": "CustomerId", - "pkName": "", - "fkTableSchema": "default", - "fkTableName": "invoices", - "fkColumnName": "CustomerId", - "fkName": "" - } - ] - }, - "invoice_items": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "invoice_items", - "columns": { - "InvoiceId": { - "name": "InvoiceId", - "scalarType": "INTEGER", - "nullable": false - }, - "TrackId": { - "name": "TrackId", - "scalarType": "INTEGER", - "nullable": false - }, - "InvoiceLineId": { - "name": "InvoiceLineId", - "scalarType": "INTEGER", - "nullable": false - }, - "UnitPrice": { - "name": "UnitPrice", - "scalarType": "FLOAT", - "nullable": false - }, - "Quantity": { - "name": "Quantity", - "scalarType": "INTEGER", - "nullable": false - } - }, - "primaryKeys": [ - "InvoiceLineId" - ], - "exportedKeys": [] - }, - "playlists": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "playlists", - "columns": { - "Name": { - "name": "Name", - "scalarType": "VARCHAR", - "nullable": true - }, - "PlaylistId": { - "name": "PlaylistId", - "scalarType": "INTEGER", - "nullable": false - } - }, - "primaryKeys": [ - "PlaylistId" - ], - "exportedKeys": [ - { - "pkTableSchema": "default", - "pkTableName": "playlists", - "pkColumnName": "PlaylistId", - "pkName": "", - "fkTableSchema": "default", - "fkTableName": "playlist_track", - "fkColumnName": "PlaylistId", - "fkName": "" - } - ] - }, - "playlist_track": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "playlist_track", - "columns": { - "PlaylistId": { - "name": "PlaylistId", - "scalarType": "INTEGER", - "nullable": false - }, - "TrackId": { - "name": "TrackId", - "scalarType": "INTEGER", - "nullable": false - } - }, - "primaryKeys": [ - "PlaylistId", - "TrackId" - ], - "exportedKeys": [] - }, - "media_types": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "media_types", - "columns": { - "MediaTypeId": { - "name": "MediaTypeId", - "scalarType": "INTEGER", - "nullable": false - }, - "Name": { - "name": "Name", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [ - "MediaTypeId" - ], - "exportedKeys": [ - { - "pkTableSchema": "default", - "pkTableName": "media_types", - "pkColumnName": "MediaTypeId", - "pkName": "", - "fkTableSchema": "default", - "fkTableName": "tracks", - "fkColumnName": "MediaTypeId", - "fkName": "" - } - ] - }, - "employees": { - "physicalSchema": "default", - "catalog": "", - "schema": "default", - "name": "employees", - "columns": { - "PostalCode": { - "name": "PostalCode", - "scalarType": "VARCHAR", - "nullable": true - }, - "BirthDate": { - "name": "BirthDate", - "scalarType": "TIMESTAMP", - "nullable": true - }, - "Title": { - "name": "Title", - "scalarType": "VARCHAR", - "nullable": true - }, - "ReportsTo": { - "name": "ReportsTo", - "scalarType": "INTEGER", - "nullable": true - }, - "State": { - "name": "State", - "scalarType": "VARCHAR", - "nullable": true - }, - "HireDate": { - "name": "HireDate", - "scalarType": "TIMESTAMP", - "nullable": true - }, - "EmployeeId": { - "name": "EmployeeId", - "scalarType": "INTEGER", - "nullable": false - }, - "FirstName": { - "name": "FirstName", - "scalarType": "VARCHAR", - "nullable": false - }, - "Email": { - "name": "Email", - "scalarType": "VARCHAR", - "nullable": true - }, - "City": { - "name": "City", - "scalarType": "VARCHAR", - "nullable": true - }, - "Phone": { - "name": "Phone", - "scalarType": "VARCHAR", - "nullable": true - }, - "Fax": { - "name": "Fax", - "scalarType": "VARCHAR", - "nullable": true - }, - "Country": { - "name": "Country", - "scalarType": "VARCHAR", - "nullable": true - }, - "LastName": { - "name": "LastName", - "scalarType": "VARCHAR", - "nullable": false - }, - "Address": { - "name": "Address", - "scalarType": "VARCHAR", - "nullable": true - } - }, - "primaryKeys": [ - "EmployeeId" - ], - "exportedKeys": [ - { - "pkTableSchema": "default", - "pkTableName": "employees", - "pkColumnName": "EmployeeId", - "pkName": "", - "fkTableSchema": "default", - "fkTableName": "customers", - "fkColumnName": "SupportRepId", - "fkName": "" - }, - { - "pkTableSchema": "default", - "pkTableName": "employees", - "pkColumnName": "EmployeeId", - "pkName": "", - "fkTableSchema": "default", - "fkTableName": "employees", - "fkColumnName": "ReportsTo", - "fkName": "" - } - ] - } - } -} \ No newline at end of file diff --git a/adapters/kafka/dev.local.configuration.json b/adapters/kafka/configuration.json similarity index 100% rename from adapters/kafka/dev.local.configuration.json rename to adapters/kafka/configuration.json diff --git a/adapters/redshift/configuration.json b/adapters/redshift/configuration.json index 3238bd6..45c1cbb 100644 --- a/adapters/redshift/configuration.json +++ b/adapters/redshift/configuration.json @@ -2,6 +2,5 @@ "version": "5", "$schema": "schema.json", "model_file_path": "./model.json", - "fixes": true, - "supportJsonObject": true + "fixes": true } \ No newline at end of file diff --git a/adapters/redshift/dev.local.configuration.json b/adapters/redshift/dev.local.configuration.json deleted file mode 100644 index 45c1cbb..0000000 --- a/adapters/redshift/dev.local.configuration.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "5", - "$schema": "schema.json", - "model_file_path": "./model.json", - "fixes": true -} \ No newline at end of file diff --git a/adapters/snowflake/dev.local.configuration.json b/adapters/snowflake/configuration.json similarity index 100% rename from adapters/snowflake/dev.local.configuration.json rename to adapters/snowflake/configuration.json diff --git a/adapters/sybase/dev.local.configuration.json b/adapters/sybase/configuration.json similarity index 100% rename from adapters/sybase/dev.local.configuration.json rename to adapters/sybase/configuration.json diff --git a/adapters/trino/dev.local.configuration.json b/adapters/trino/configuration.json similarity index 100% rename from adapters/trino/dev.local.configuration.json rename to adapters/trino/configuration.json diff --git a/build.sh b/build.sh index 8374b9a..463273d 100755 --- a/build.sh +++ b/build.sh @@ -15,10 +15,9 @@ TAG=$(echo "$release_info" | grep 'tag_name' | awk -F':' '{print $2}' | tr -d ' # build arm & amd versions # docker build . --no-cache --platform linux/arm64,linux/amd64 -t ghcr.io/hasura/ndc-calcite:latest -docker build . --no-cache -t ghcr.io/hasura/ndc-calcite:latest +docker build . --no-cache -t ghcr.io/hasura/ndc-calcite:"$TAG" #docker buildx build --platform linux/arm64 --output type=oci,dest=./image.tar . docker tag ghcr.io/hasura/ndc-calcite:"$TAG" # push to docker hub -docker push ghcr.io/hasura/ndc-calcite:latest docker push ghcr.io/hasura/ndc-calcite:"$TAG" diff --git a/crates/calcite-schema/src/schema.rs b/crates/calcite-schema/src/schema.rs index 5e556e5..b0958cb 100644 --- a/crates/calcite-schema/src/schema.rs +++ b/crates/calcite-schema/src/schema.rs @@ -10,8 +10,7 @@ use ndc_models as models; use ndc_models::SchemaResponse; use ndc_sdk::connector::{ErrorResponse, Result}; use tracing::{debug, event, Level}; -use ndc_calcite_values::is_running_in_container::is_running_in_container; -use ndc_calcite_values::values::{CONFIGURATION_FILENAME, DEV_CONFIG_FILE_NAME, DOCKER_CONNECTOR_RW}; +use ndc_calcite_values::values::{CONFIGURATION_FILENAME, DOCKER_CONNECTOR_RW}; use crate::{collections, scalars}; use crate::models::get_models; use crate::version5::ParsedConfiguration; @@ -49,10 +48,7 @@ pub fn get_schema(configuration: &ParsedConfiguration, calcite_ref: GlobalRef) - data_models = get_models(&calcite_ref); } let scalar_types = scalars::scalars(); - let (object_types, collections) = match collections::collections(&data_models, &scalar_types) { - Ok(value) => value, - Err(value) => return Err(value), - }; + let (object_types, collections) = collections::collections(&data_models, &scalar_types)?; let procedures = vec![]; let functions: Vec = vec![]; let schema = SchemaResponse { @@ -62,11 +58,7 @@ pub fn get_schema(configuration: &ParsedConfiguration, calcite_ref: GlobalRef) - functions, procedures, }; - let file_path = if is_running_in_container() { - Path::new(DOCKER_CONNECTOR_RW).join(CONFIGURATION_FILENAME) - } else { - Path::new(".").join(DEV_CONFIG_FILE_NAME) - }; + let file_path = Path::new(DOCKER_CONNECTOR_RW).join(CONFIGURATION_FILENAME); event!(Level::INFO, config_path = format!("Configuration file path: {}", file_path.display())); let mut new_configuration = configuration.clone(); new_configuration.metadata = Some(data_models.clone()); diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs index a47ea3f..917b38a 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -20,7 +20,7 @@ use ndc_calcite_schema::configuration::{ use ndc_calcite_schema::environment::{Environment, Variable}; use ndc_calcite_schema::jvm::init_jvm; use ndc_calcite_schema::version5::CalciteRefSingleton; -use ndc_calcite_values::is_running_in_container::is_running_in_container; + use ndc_calcite_values::values::{ DOCKER_CONNECTOR_DIR, DOCKER_CONNECTOR_RW, DOCKER_IMAGE_NAME, UNABLE_TO_WRITE_TO_FILE, }; @@ -94,12 +94,7 @@ async fn initialize( with_metadata: bool, context: &Context, ) -> anyhow::Result<()> { - let docker_config_path = &PathBuf::from(DOCKER_CONNECTOR_RW); - let config_path = if is_running_in_container() { - docker_config_path - } else { - &context.context_path - }; + let config_path = &context.context_path; if has_configuration(config_path) { Err(Error::DirectoryIsNotEmpty)?; } @@ -170,12 +165,7 @@ async fn update( context: Context, calcite_ref_singleton: &CalciteRefSingleton, ) -> anyhow::Result<()> { - let docker_config_path = &PathBuf::from(DOCKER_CONNECTOR_DIR); - let config_path = if is_running_in_container() { - docker_config_path - } else { - &context.context_path - }; + let config_path = &context.context_path; // Read the `connector-metadata.yaml` file and create a map of supported environment variables let metadata_yaml_file = config_path.join(".hasura-connector/connector-metadata.yaml"); @@ -185,7 +175,7 @@ async fn update( metadata::ConnectorMetadataDefinition, >(&metadata_yaml)?)) } else { - Err(anyhow::Error::msg("Metadata file does not exist")) + Err(anyhow::Error::msg("Metadata file does not exist at {config_path}.hasura-connector/connector-metadata.yaml")) }?; let supported_env_vars = metadata .as_ref() diff --git a/crates/connectors/ndc-calcite/src/connector/calcite.rs b/crates/connectors/ndc-calcite/src/connector/calcite.rs index 2b7329f..8f953fb 100644 --- a/crates/connectors/ndc-calcite/src/connector/calcite.rs +++ b/crates/connectors/ndc-calcite/src/connector/calcite.rs @@ -11,6 +11,7 @@ use async_trait::async_trait; use dotenv; use http::status::StatusCode; use jni::objects::GlobalRef; +use ndc_calcite_values::values::CONFIGURATION_FILENAME; use ndc_models as models; use ndc_models::{ArgumentName, Capabilities, CollectionName, Relationship, RelationshipName, VariableName}; use ndc_sdk::connector::{Connector, ConnectorSetup, ErrorResponse}; @@ -25,8 +26,6 @@ use ndc_calcite_schema::jvm::{get_jvm, init_jvm}; use ndc_calcite_schema::calcite::Model; use ndc_calcite_schema::schema::get_schema as retrieve_schema; use ndc_calcite_schema::version5::ParsedConfiguration; -use ndc_calcite_values::is_running_in_container::is_running_in_container; -use ndc_calcite_values::values::{CONFIGURATION_FILENAME, DEV_CONFIG_FILE_NAME}; use crate::{calcite, query}; use crate::calcite::CalciteError; use crate::query::QueryParams; @@ -77,18 +76,10 @@ impl ConnectorSetup for Calcite { dotenv::dotenv().ok(); fn get_config_file_path(configuration_dir: impl AsRef + Send) -> PathBuf { - if is_running_in_container() { configuration_dir.as_ref().join(CONFIGURATION_FILENAME) - } else { - configuration_dir.as_ref().join(DEV_CONFIG_FILE_NAME) - } } fn configure_path(span: Span, configuration_dir: &(impl AsRef + Send)) { - println!( - "Configuration file path: {:?}", - configuration_dir.as_ref().display() - ); span.record("configuration_dir", format!("{:?}", configuration_dir.as_ref().display())); } diff --git a/crates/values/src/is_running_in_container.rs b/crates/values/src/is_running_in_container.rs deleted file mode 100644 index cef4ee8..0000000 --- a/crates/values/src/is_running_in_container.rs +++ /dev/null @@ -1,28 +0,0 @@ -use std::env; -use std::path::Path; -use tracing::{Level}; - -/// Checks if the code is running inside a container. -/// -/// This function checks for the existence of the `/.dockerenv` file in the filesystem, -/// which is commonly used to indicate that the code is running inside a Docker container. -/// -/// # Examples -/// -/// ``` -/// use std::path::Path; -/// -/// fn is_running_in_container() -> bool { -/// Path::new("/.dockerenv").exists() -/// } -/// -/// assert_eq!(is_running_in_container(), false); -/// ``` -/// -/// # Returns -/// -/// Returns `true` if the code is running inside a container, `false` otherwise. -#[tracing::instrument(skip(), level=Level::INFO)] -pub fn is_running_in_container() -> bool { - Path::new("/.dockerenv").exists() || env::var("KUBERNETES_SERVICE_HOST").is_ok() -} \ No newline at end of file diff --git a/crates/values/src/lib.rs b/crates/values/src/lib.rs index 46373e1..3a8f767 100644 --- a/crates/values/src/lib.rs +++ b/crates/values/src/lib.rs @@ -1,2 +1 @@ pub mod values; -pub mod is_running_in_container; diff --git a/crates/values/src/values.rs b/crates/values/src/values.rs index c104834..d839d56 100644 --- a/crates/values/src/values.rs +++ b/crates/values/src/values.rs @@ -1,4 +1,4 @@ -pub const DEV_CONFIG_FILE_NAME: &str = "dev.local.configuration.json"; + pub const CONFIGURATION_FILENAME: &str = "configuration.json"; pub const CONFIGURATION_JSONSCHEMA_FILENAME: &str = "schema.json"; pub const DOCKER_IMAGE_NAME: &str = "ghcr.io/hasura/ndc-calcite";