You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2016/07/31 06:18:25 UTC
[1/2] calcite git commit: [CALCITE-1333] JdbcAggregate should check
SqlKind instead SqlAggFunction (Minji Kim)
Repository: calcite
Updated Branches:
refs/heads/master b4df7c97b -> 5c74b6b41
[CALCITE-1333] JdbcAggregate should check SqlKind instead SqlAggFunction (Minji Kim)
Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/6d56222d
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/6d56222d
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/6d56222d
Branch: refs/heads/master
Commit: 6d56222dab93551d357076d158cb03ca479b3bbd
Parents: b4df7c9
Author: Minji Kim <mi...@dremio.com>
Authored: Thu Jul 7 20:42:47 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Sat Jul 30 11:47:06 2016 -0700
----------------------------------------------------------------------
.../apache/calcite/adapter/jdbc/JdbcRules.java | 27 ++++++++++----------
1 file changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/calcite/blob/6d56222d/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcRules.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcRules.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcRules.java
index a1a786d..03c36c1 100644
--- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcRules.java
+++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcRules.java
@@ -69,7 +69,7 @@ import org.apache.calcite.rex.RexProgram;
import org.apache.calcite.schema.ModifiableTable;
import org.apache.calcite.sql.SqlAggFunction;
import org.apache.calcite.sql.SqlDialect;
-import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.apache.calcite.sql.SqlKind;
import org.apache.calcite.util.ImmutableBitSet;
import org.apache.calcite.util.Util;
import org.apache.calcite.util.trace.CalciteTrace;
@@ -109,18 +109,18 @@ public class JdbcRules {
new JdbcValuesRule(out));
}
- static final ImmutableList<SqlAggFunction> AGG_FUNCS;
- static final ImmutableList<SqlAggFunction> MYSQL_AGG_FUNCS;
+ static final ImmutableList<SqlKind> AGG_FUNCS;
+ static final ImmutableList<SqlKind> MYSQL_AGG_FUNCS;
static {
- ImmutableList.Builder<SqlAggFunction> builder = ImmutableList.builder();
- builder.add(SqlStdOperatorTable.COUNT);
- builder.add(SqlStdOperatorTable.SUM);
- builder.add(SqlStdOperatorTable.SUM0);
- builder.add(SqlStdOperatorTable.MIN);
- builder.add(SqlStdOperatorTable.MAX);
+ ImmutableList.Builder<SqlKind> builder = ImmutableList.builder();
+ builder.add(SqlKind.COUNT);
+ builder.add(SqlKind.SUM);
+ builder.add(SqlKind.SUM0);
+ builder.add(SqlKind.MIN);
+ builder.add(SqlKind.MAX);
AGG_FUNCS = builder.build();
- builder.add(SqlStdOperatorTable.SINGLE_VALUE);
+ builder.add(SqlKind.SINGLE_VALUE);
MYSQL_AGG_FUNCS = builder.build();
}
@@ -476,13 +476,12 @@ public class JdbcRules {
/** Returns whether this JDBC data source can implement a given aggregate
* function. */
- private static boolean canImplement(SqlAggFunction aggregation,
- SqlDialect sqlDialect) {
+ private static boolean canImplement(SqlAggFunction aggregation, SqlDialect sqlDialect) {
switch (sqlDialect.getDatabaseProduct()) {
case MYSQL:
- return MYSQL_AGG_FUNCS.contains(aggregation);
+ return MYSQL_AGG_FUNCS.contains(aggregation.getKind());
default:
- return AGG_FUNCS.contains(aggregation);
+ return AGG_FUNCS.contains(aggregation.getKind());
}
}
[2/2] calcite git commit: [CALCITE-1043] RelOptUtil should check
SqlKind instead of operator instance (Minji Kim)
Posted by jh...@apache.org.
[CALCITE-1043] RelOptUtil should check SqlKind instead of operator instance (Minji Kim)
Close apache/calcite#262
Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/5c74b6b4
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/5c74b6b4
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/5c74b6b4
Branch: refs/heads/master
Commit: 5c74b6b41c33af466c0b1798101d84df56138725
Parents: 6d56222
Author: Minji Kim <mi...@dremio.com>
Authored: Thu Jul 28 16:22:43 2016 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Sat Jul 30 11:47:31 2016 -0700
----------------------------------------------------------------------
core/src/main/java/org/apache/calcite/plan/RelOptUtil.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/calcite/blob/5c74b6b4/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java b/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
index d9d2a63..0340b1b 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
@@ -1263,7 +1263,7 @@ public abstract class RelOptUtil {
List<RexNode> nonEquiList) {
if (condition instanceof RexCall) {
RexCall call = (RexCall) condition;
- if (call.getOperator() == SqlStdOperatorTable.AND) {
+ if (call.getOperator().getKind() == SqlKind.AND) {
for (RexNode operand : call.getOperands()) {
splitCorrelatedFilterCondition(
filter,
@@ -1275,7 +1275,7 @@ public abstract class RelOptUtil {
return;
}
- if (call.getOperator() == SqlStdOperatorTable.EQUALS) {
+ if (call.getOperator().getKind() == SqlKind.EQUALS) {
final List<RexNode> operands = call.getOperands();
RexNode op0 = operands.get(0);
RexNode op1 = operands.get(1);
@@ -1310,7 +1310,7 @@ public abstract class RelOptUtil {
boolean extractCorrelatedFieldAccess) {
if (condition instanceof RexCall) {
RexCall call = (RexCall) condition;
- if (call.getOperator() == SqlStdOperatorTable.AND) {
+ if (call.getOperator().getKind() == SqlKind.AND) {
for (RexNode operand : call.getOperands()) {
splitCorrelatedFilterCondition(
filter,
@@ -1323,7 +1323,7 @@ public abstract class RelOptUtil {
return;
}
- if (call.getOperator() == SqlStdOperatorTable.EQUALS) {
+ if (call.getOperator().getKind() == SqlKind.EQUALS) {
final List<RexNode> operands = call.getOperands();
RexNode op0 = operands.get(0);
RexNode op1 = operands.get(1);