rowType, viewTable, nonPartitionColumns, partitionColumns, new ArrayList<>(), conf, new HashMap<>(), new HashMap<>(), new AtomicInteger()); DruidTable druidTable = new DruidTable(new DruidSchema(address, address, false), dataSource, RelDataTypeImpl.proto(rowType), metrics, DruidTable.DEFAULT_TIMESTAMP_COLUMN, intervals, null, null);
@Override protected Map<String, Table> getTableMap() { if (!discoverTables) { return ImmutableMap.of(); } if (tableMap == null) { final DruidConnectionImpl connection = new DruidConnectionImpl(url, coordinatorUrl); Set<String> tableNames = connection.tableNames(); tableMap = Maps.asMap( ImmutableSet.copyOf(tableNames), CacheBuilder.newBuilder() .build(CacheLoader.from(name -> table(name, connection)))); } return tableMap; }
DruidTable druidTable = new DruidTable(new DruidSchema(address, address, false), dataSource, RelDataTypeImpl.proto(rowType), metrics, DruidTable.DEFAULT_TIMESTAMP_COLUMN, intervals); final TableScan scan = new HiveTableScan(cluster, cluster.traitSetOf(HiveRelNode.CONVENTION),
DruidTable druidTable = new DruidTable(new DruidSchema(address, address, false), dataSource, RelDataTypeImpl.proto(rowType), metrics, DruidTable.DEFAULT_TIMESTAMP_COLUMN, intervals); final TableScan scan = new HiveTableScan(cluster, cluster.traitSetOf(HiveRelNode.CONVENTION),
DruidTable druidTable = new DruidTable(new DruidSchema(address, address, false), dataSource, RelDataTypeImpl.proto(rowType), metrics, DruidTable.DEFAULT_TIMESTAMP_COLUMN, intervals, null, null);
public Schema create(SchemaPlus parentSchema, String name, Map<String, Object> operand) { final String url = operand.get("url") instanceof String ? (String) operand.get("url") : DEFAULT_URL; final String coordinatorUrl = operand.get("coordinatorUrl") instanceof String ? (String) operand.get("coordinatorUrl") : url.replace(":8082", ":8081"); // "tables" is a hidden attribute, copied in from the enclosing custom // schema final boolean containsTables = operand.get("tables") instanceof List && ((List) operand.get("tables")).size() > 0; return new DruidSchema(url, coordinatorUrl, !containsTables); } }
public Schema create(SchemaPlus parentSchema, String name, Map<String, Object> operand) { final String url = operand.get("url") instanceof String ? (String) operand.get("url") : DEFAULT_URL; final String coordinatorUrl = operand.get("coordinatorUrl") instanceof String ? (String) operand.get("coordinatorUrl") : url.replace(":8082", ":8081"); // "tables" is a hidden attribute, copied in from the enclosing custom // schema final boolean containsTables = operand.get("tables") instanceof List && ((List) operand.get("tables")).size() > 0; return new DruidSchema(url, coordinatorUrl, !containsTables); } }
/** * Test to make sure that the mapping from a Table name to a Table returned from * {@link org.apache.calcite.adapter.druid.DruidSchema} is always the same Java object. * */ @Test public void testTableMapReused() { AbstractSchema schema = new DruidSchema( "http://localhost:8082", "http://localhost:8081", true); assertSame(schema.getTable("wikiticker"), schema.getTable("wikiticker")); }
/** * Test to make sure that the mapping from a Table name to a Table returned from * {@link org.apache.calcite.adapter.druid.DruidSchema} is always the same Java object. * */ @Test public void testTableMapReused() { AbstractSchema schema = new DruidSchema("http://localhost:8082", "http://localhost:8081", true); assertSame(schema.getTable("wikiticker"), schema.getTable("wikiticker")); }