コード例 #1
0
 <T> OptiqPrepare.PrepareResult<T> parseQuery(
     String sql, OptiqPrepare.Context prepareContext, int maxRowCount) {
   OptiqPrepare.Dummy.push(prepareContext);
   try {
     final OptiqPrepare prepare = prepareFactory.apply();
     return prepare.prepareSql(prepareContext, sql, null, Object[].class, maxRowCount);
   } finally {
     OptiqPrepare.Dummy.pop(prepareContext);
   }
 }
コード例 #2
0
ファイル: Schemas.java プロジェクト: jacques-n/optiq
 /** Parses and validates a SQL query. For use within Optiq only. */
 public static OptiqPrepare.ParseResult parse(
     final OptiqConnection connection,
     final OptiqSchema schema,
     final List<String> schemaPath,
     final String sql) {
   final OptiqPrepare prepare = OptiqPrepare.DEFAULT_FACTORY.apply();
   final OptiqPrepare.Context context = makeContext(connection, schema, schemaPath);
   OptiqPrepare.Dummy.push(context);
   try {
     return prepare.parse(context, sql);
   } finally {
     OptiqPrepare.Dummy.pop(context);
   }
 }
コード例 #3
0
ファイル: Schemas.java プロジェクト: jacques-n/optiq
 private static OptiqPrepare.Context makeContext(
     final OptiqConnection connection, final OptiqSchema schema, final List<String> schemaPath) {
   if (connection == null) {
     final OptiqPrepare.Context context0 = OptiqPrepare.Dummy.peek();
     return makeContext(
         context0.config(),
         context0.getTypeFactory(),
         context0.getDataContext(),
         schema,
         schemaPath);
   } else {
     return makeContext(
         connection.config(),
         connection.getTypeFactory(),
         createDataContext(connection),
         schema,
         schemaPath);
   }
 }
コード例 #4
0
 public OptiqPrepare.SparkHandler spark() {
   final boolean enable = config().spark();
   return OptiqPrepare.Dummy.getSparkHandler(enable);
 }