public static Builder builder(CalciteSchema calciteSchema, String sql) { return builder(new LatticeSpace(MapSqlStatisticProvider.INSTANCE), calciteSchema, sql); }
/** Creates a Lattice. */ public static Lattice create(CalciteSchema schema, String sql, boolean auto) { return builder(schema, sql).auto(auto).build(); }
/** Creates a Lattice. */ public static Lattice create(CalciteSchema schema, String sql, boolean auto) { return builder(schema, sql).auto(auto).build(); }
public Lattice build(CalciteSchema calciteSchema, QuarkTable quarkTable) { Lattice.Builder latticeBuilder = Lattice.builder(calciteSchema, toString(this.sql)) .auto(false) .algorithm(false);
public void visit(JsonLattice jsonLattice) { try { checkRequiredAttributes(jsonLattice, "name", "sql"); final SchemaPlus schema = currentSchema(); if (!schema.isMutable()) { throw new RuntimeException("Cannot define lattice; parent schema '" + currentSchemaName() + "' is not a SemiMutableSchema"); } CalciteSchema calciteSchema = CalciteSchema.from(schema); Lattice.Builder latticeBuilder = Lattice.builder(calciteSchema, jsonLattice.getSql()) .auto(jsonLattice.auto) .algorithm(jsonLattice.algorithm); if (jsonLattice.rowCountEstimate != null) { latticeBuilder.rowCountEstimate(jsonLattice.rowCountEstimate); } if (jsonLattice.statisticProvider != null) { latticeBuilder.statisticProvider(jsonLattice.statisticProvider); } populateLattice(jsonLattice, latticeBuilder); schema.add(jsonLattice.name, latticeBuilder.build()); } catch (Exception e) { throw new RuntimeException("Error instantiating " + jsonLattice, e); } }
public void visit(JsonLattice jsonLattice) { try { checkRequiredAttributes(jsonLattice, "name", "sql"); final SchemaPlus schema = currentSchema(); if (!schema.isMutable()) { throw new RuntimeException("Cannot define lattice; parent schema '" + currentSchemaName() + "' is not a SemiMutableSchema"); } CalciteSchema calciteSchema = CalciteSchema.from(schema); Lattice.Builder latticeBuilder = Lattice.builder(calciteSchema, jsonLattice.getSql()) .auto(jsonLattice.auto) .algorithm(jsonLattice.algorithm); if (jsonLattice.rowCountEstimate != null) { latticeBuilder.rowCountEstimate(jsonLattice.rowCountEstimate); } if (jsonLattice.statisticProvider != null) { latticeBuilder.statisticProvider(jsonLattice.statisticProvider); } populateLattice(jsonLattice, latticeBuilder); schema.add(jsonLattice.name, latticeBuilder.build()); } catch (Exception e) { throw new RuntimeException("Error instantiating " + jsonLattice, e); } }