Codota Logo
CloneSchema
Code IndexAdd Codota to your IDE (free)

How to use
CloneSchema
in
net.hydromatic.optiq.impl.clone

Best Java code snippets using net.hydromatic.optiq.impl.clone.CloneSchema (Showing top 13 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: org.apache.optiq/optiq-core

 public Schema create(
   SchemaPlus parentSchema,
   String name,
   Map<String, Object> operand) {
  SchemaPlus schema =
    parentSchema.add(name,
      JdbcSchema.create(parentSchema, name + "$source", operand));
  return new CloneSchema(schema);
 }
}
origin: net.hydromatic/optiq

 public Schema create(
   MutableSchema parentSchema,
   String name,
   Map<String, Object> operand) {
  JdbcSchema jdbcSchema =
    JdbcSchema.create(parentSchema, name + "$source", operand);
  return CloneSchema.create(parentSchema, name, jdbcSchema);
 }
}
origin: org.apache.optiq/optiq-core

@Override
protected Map<String, Table> getTableMap() {
 final Map<String, Table> map = new LinkedHashMap<String, Table>();
 for (String name : sourceSchema.getTableNames()) {
  final QueryableTable sourceTable =
    (QueryableTable) sourceSchema.getTable(name);
  map.put(name,
    createCloneTable(MATERIALIZATION_CONNECTION, sourceTable, name));
 }
 return map;
}
origin: net.hydromatic/optiq

private <T> Table<T> createCloneTable(Table<T> sourceTable, String name) {
 final TableInSchema tableInSchema =
   createCloneTable(this, name, sourceTable.getRowType(), sourceTable);
 addTable(tableInSchema);
 return tableInSchema.getTable(null);
}
origin: net.hydromatic/optiq

/**
 * Creates a CloneSchema within another schema.
 *
 * @param parentSchema Parent schema
 * @param name Name of new schema
 * @param sourceSchema Source schema
 * @return New CloneSchema
 */
public static CloneSchema create(
  MutableSchema parentSchema,
  String name,
  Schema sourceSchema) {
 CloneSchema schema =
   new CloneSchema(
     parentSchema,
     name,
     parentSchema.getSubSchemaExpression(name, Object.class),
     sourceSchema);
 parentSchema.addSchema(name, schema);
 return schema;
}
origin: net.hydromatic/optiq

@Override
public <E> Table<E> getTable(String name, Class<E> elementType) {
 // TODO: check elementType matches table.elementType
 assert elementType != null;
 Table<E> table = super.getTable(name, elementType);
 if (table != null) {
  return table;
 }
 // TODO: make thread safe!
 Table<E> sourceTable = sourceSchema.getTable(name, elementType);
 if (sourceTable != null) {
  //noinspection unchecked
  return createCloneTable(sourceTable, name);
 }
 return null;
}
origin: net.hydromatic/optiq

@Test public void testCloneSchema()
  throws ClassNotFoundException, SQLException {
 final OptiqConnection connection = JdbcTest.getConnection(null, false);
 Schema foodmart = connection.getRootSchema().getSubSchema("foodmart");
 CloneSchema.create(connection.getRootSchema(), "foodmart2", foodmart);
 Statement statement = connection.createStatement();
 ResultSet resultSet =
   statement.executeQuery(
     "select count(*) from \"foodmart2\".\"time_by_day\"");
 assertTrue(resultSet.next());
 assertEquals(730, resultSet.getInt(1));
 resultSet.close();
 connection.close();
}
origin: org.apache.optiq/optiq-core

@Test public void testCloneSchema()
  throws ClassNotFoundException, SQLException {
 final OptiqConnection connection = OptiqAssert.getConnection(false);
 final SchemaPlus rootSchema = connection.getRootSchema();
 final SchemaPlus foodmart = rootSchema.getSubSchema("foodmart");
 rootSchema.add("foodmart2", new CloneSchema(foodmart));
 Statement statement = connection.createStatement();
 ResultSet resultSet =
   statement.executeQuery(
     "select count(*) from \"foodmart2\".\"time_by_day\"");
 assertTrue(resultSet.next());
 assertEquals(730, resultSet.getInt(1));
 resultSet.close();
 connection.close();
}
origin: org.apache.optiq/optiq-core

private Table createCloneTable(QueryProvider queryProvider,
  QueryableTable sourceTable, String name) {
 final Queryable<Object> queryable =
   sourceTable.asQueryable(queryProvider, sourceSchema, name);
 final JavaTypeFactory typeFactory =
   ((OptiqConnection) queryProvider).getTypeFactory();
 return createCloneTable(typeFactory, Schemas.proto(sourceTable), null,
   queryable);
}
origin: net.hydromatic/optiq

    "foodmart");
if (withClone) {
 CloneSchema.create(
   optiqConnection.getRootSchema(), "foodmart2", foodmart);
origin: org.apache.optiq/optiq-core

  foodmart = OptiqAssert.addSchema(rootSchema, SchemaSpec.JDBC_FOODMART);
 return rootSchema.add("foodmart2", new CloneSchema(foodmart));
case HR:
 return rootSchema.add("hr",
origin: net.hydromatic/optiq

  Schemas.prepare(schema, viewSchemaPath, viewSql);
materializedTable =
  CloneSchema.createCloneTable((MutableSchema) schema, tableName,
    prepareResult.rowType,
    new AbstractQueryable<Object>() {
origin: org.apache.optiq/optiq-core

final JavaTypeFactory typeFactory = connection.getTypeFactory();
materializedTable =
  CloneSchema.createCloneTable(typeFactory,
    RelDataTypeImpl.proto(prepareResult.rowType),
    Functions.adapt(prepareResult.structType.columns,
net.hydromatic.optiq.impl.cloneCloneSchema

Javadoc

Schema that contains in-memory copies of tables from a JDBC schema.

Most used methods

  • <init>
    Creates a CloneSchema.
  • create
    Creates a CloneSchema within another schema.
  • createCloneTable
  • addTable

Popular in Java

  • Creating JSON documents from java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • JTextField (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Table (org.hibernate.mapping)
    A relational table
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now