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

How to use
JdbcTable
in
org.apache.calcite.adapter.jdbc

Best Java code snippets using org.apache.calcite.adapter.jdbc.JdbcTable (Showing top 15 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: tzolov/calcite-sql-rewriter

static String getTableName(JdbcTable table) {
  // tableName is: [catalog,] [schema,] table
  SqlIdentifier identifier = table.tableName();
  return identifier.names.get(identifier.names.size() - 1);
}
origin: tzolov/calcite-sql-rewriter

static RelNode toRel(RelOptCluster cluster, RelOptSchema relOptSchema, JdbcTable table, List<String> qualifiedName) {
  RelOptTable.ToRelContext toRelContext = new RelOptTable.ToRelContext() {
    @Override
    public RelOptCluster getCluster() {
      return cluster;
    }
    @Override
    public RelRoot expandView(RelDataType rowType, String queryString, List<String> schemaPath, List<String> viewPath) {
      throw new UnsupportedOperationException();
    }
  };
  return table.toRel(
      toRelContext,
      relOptSchema.getTableForMember(qualifiedName)
  );
}
origin: Qihoo360/Quicksql

public Enumerable<Object[]> scan(DataContext root) {
 final JavaTypeFactory typeFactory = root.getTypeFactory();
 final SqlString sql = generateSql();
 return ResultSetEnumerable.of(jdbcSchema.getDataSource(), sql.getSql(),
   JdbcUtils.ObjectArrayRowBuilder.factory(fieldClasses(typeFactory)));
}
origin: Qihoo360/Quicksql

 public Enumerator<T> enumerator() {
  final JavaTypeFactory typeFactory =
    ((CalciteConnection) queryProvider).getTypeFactory();
  final SqlString sql = generateSql();
  //noinspection unchecked
  final Enumerable<T> enumerable = (Enumerable<T>) ResultSetEnumerable.of(
    jdbcSchema.getDataSource(),
    sql.getSql(),
    JdbcUtils.ObjectArrayRowBuilder.factory(fieldClasses(typeFactory)));
  return enumerable.enumerator();
 }
}
origin: Qihoo360/Quicksql

  new JdbcTable(this, catalogName, schemaName, tableName, tableType);
builder.put(tableName, table);
origin: tzolov/calcite-sql-rewriter

JournalledJdbcTable(
    String tableName,
    JournalledJdbcSchema journalledJdbcSchema,
    JdbcTable journalTable,
    String[] keyColumnNames
) {
  super(
      journalledJdbcSchema,
      JdbcTableUtils.getCatalogName(journalTable),
      JdbcTableUtils.getSchemaName(journalTable),
      tableName,
      journalTable.getJdbcTableType()
  );
  this.journalTable = journalTable;
  this.journalledJdbcSchema = journalledJdbcSchema;
  this.keyColumnNames = ImmutableList.copyOf(keyColumnNames);
}
origin: org.apache.calcite/calcite-core

public Enumerable<Object[]> scan(DataContext root) {
 final JavaTypeFactory typeFactory = root.getTypeFactory();
 final SqlString sql = generateSql();
 return ResultSetEnumerable.of(jdbcSchema.getDataSource(), sql.getSql(),
   JdbcUtils.ObjectArrayRowBuilder.factory(fieldClasses(typeFactory)));
}
origin: org.apache.calcite/calcite-core

 public Enumerator<T> enumerator() {
  final JavaTypeFactory typeFactory =
    ((CalciteConnection) queryProvider).getTypeFactory();
  final SqlString sql = generateSql();
  //noinspection unchecked
  final Enumerable<T> enumerable = (Enumerable<T>) ResultSetEnumerable.of(
    jdbcSchema.getDataSource(),
    sql.getSql(),
    JdbcUtils.ObjectArrayRowBuilder.factory(fieldClasses(typeFactory)));
  return enumerable.enumerator();
 }
}
origin: org.apache.calcite/calcite-core

  new JdbcTable(this, catalogName, schemaName, tableName, tableType);
builder.put(tableName, table);
origin: org.apache.calcite/calcite-core

/** @see #dispatch */
public Result visit(JdbcTableScan scan) {
 return result(scan.jdbcTable.tableName(),
   ImmutableList.of(Clause.FROM), scan, null);
}
origin: Qihoo360/Quicksql

 public JdbcImplementor.Result implement(JdbcImplementor implementor) {
  return implementor.result(jdbcTable.tableName(),
    ImmutableList.of(JdbcImplementor.Clause.FROM), this, null);
 }
}
origin: Qihoo360/Quicksql

/** @see #dispatch */
public Result visit(JdbcTableScan scan) {
 return result(scan.jdbcTable.tableName(),
   ImmutableList.of(Clause.FROM), scan, null);
}
origin: org.apache.calcite/calcite-core

 public JdbcImplementor.Result implement(JdbcImplementor implementor) {
  return implementor.result(jdbcTable.tableName(),
    ImmutableList.of(JdbcImplementor.Clause.FROM), this, null);
 }
}
origin: org.apache.calcite/calcite-core

SqlString generateSql() {
 final SqlNodeList selectList =
   new SqlNodeList(
     Collections.singletonList(SqlIdentifier.star(SqlParserPos.ZERO)),
     SqlParserPos.ZERO);
 SqlSelect node =
   new SqlSelect(SqlParserPos.ZERO, SqlNodeList.EMPTY, selectList,
     tableName(), null, null, null, null, null, null, null);
 final SqlPrettyWriter writer = new SqlPrettyWriter(jdbcSchema.dialect);
 node.unparse(writer, 0, 0);
 return writer.toSqlString();
}
origin: Qihoo360/Quicksql

SqlString generateSql() {
 final SqlNodeList selectList =
   new SqlNodeList(
     Collections.singletonList(SqlIdentifier.star(SqlParserPos.ZERO)),
     SqlParserPos.ZERO);
 SqlSelect node =
   new SqlSelect(SqlParserPos.ZERO, SqlNodeList.EMPTY, selectList,
     tableName(), null, null, null, null, null, null, null);
 final SqlPrettyWriter writer = new SqlPrettyWriter(jdbcSchema.dialect);
 node.unparse(writer, 0, 0);
 return writer.toSqlString();
}
org.apache.calcite.adapter.jdbcJdbcTable

Javadoc

Queryable that gets its data from a table within a JDBC connection.

The idea is not to read the whole table, however. The idea is to use this as a building block for a query, by applying Queryable operators such as org.apache.calcite.linq4j.Queryable#where(org.apache.calcite.linq4j.function.Predicate2). The resulting queryable can then be converted to a SQL query, which can be executed efficiently on the JDBC server.

Most used methods

  • tableName
  • <init>
  • fieldClasses
  • generateSql
  • getJdbcTableType
  • toRel

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getApplicationContext (Context)
  • startActivity (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
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