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 2015/09/03 00:15:52 UTC
[04/50] incubator-calcite git commit: Re-enable a test;
fix some code formatting; fix Windows line endings
Re-enable a test; fix some code formatting; fix Windows line endings
Project: http://git-wip-us.apache.org/repos/asf/incubator-calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/830afef0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-calcite/tree/830afef0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-calcite/diff/830afef0
Branch: refs/heads/branch-release
Commit: 830afef0484e7b59de01331c2305a33c20df152e
Parents: 03111d2
Author: Julian Hyde <jh...@apache.org>
Authored: Tue Jul 7 17:34:58 2015 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Thu Jul 9 10:28:40 2015 -0700
----------------------------------------------------------------------
.../org/apache/calcite/plan/RelOptUtil.java | 9 ++----
.../org/apache/calcite/runtime/FlatLists.java | 4 +--
.../java/org/apache/calcite/test/JdbcTest.java | 12 ++++----
.../org/apache/calcite/test/RelBuilderTest.java | 8 +++---
.../calcite/adapter/mongodb/MongoTable.java | 29 +++++++++++---------
5 files changed, 30 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/830afef0/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 5436e20..5aa2177 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
@@ -2820,12 +2820,9 @@ public abstract class RelOptUtil {
*
* <p>Optimizes if the fields are the identity projection.
*
- * @param factory
- * ProjectFactory
- * @param child
- * Input relational expression
- * @param posList
- * Source of each projected field
+ * @param factory ProjectFactory
+ * @param child Input relational expression
+ * @param posList Source of each projected field
* @return Relational expression that projects given fields
*/
public static RelNode createProject(final RelFactories.ProjectFactory factory,
http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/830afef0/core/src/main/java/org/apache/calcite/runtime/FlatLists.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/runtime/FlatLists.java b/core/src/main/java/org/apache/calcite/runtime/FlatLists.java
index c2c887f..47915e7 100644
--- a/core/src/main/java/org/apache/calcite/runtime/FlatLists.java
+++ b/core/src/main/java/org/apache/calcite/runtime/FlatLists.java
@@ -219,7 +219,7 @@ public class FlatLists {
*
* <p>The list is created via {@link FlatLists#of}.
*
- * @param <T>
+ * @param <T> Element type
*/
protected static class Flat2List<T>
extends AbstractFlatList<T>
@@ -346,7 +346,7 @@ public class FlatLists {
*
* <p>The list is created via {@link FlatLists#of(java.util.List)}.
*
- * @param <T>
+ * @param <T> Element type
*/
protected static class Flat3List<T>
extends AbstractFlatList<T>
http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/830afef0/core/src/test/java/org/apache/calcite/test/JdbcTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/JdbcTest.java b/core/src/test/java/org/apache/calcite/test/JdbcTest.java
index 9bee267..658619d 100644
--- a/core/src/test/java/org/apache/calcite/test/JdbcTest.java
+++ b/core/src/test/java/org/apache/calcite/test/JdbcTest.java
@@ -3379,20 +3379,18 @@ public class JdbcTest {
}
/** Tests sorting by a column that is already sorted. */
- @Ignore("fix output for timezone")
@Test public void testOrderByOnSortedTable2() {
CalciteAssert.that()
.with(CalciteAssert.Config.FOODMART_CLONE)
.query("select \"time_id\", \"the_date\" from \"time_by_day\"\n"
+ "where \"time_id\" < 370\n"
+ "order by \"time_id\"")
- .returns("time_id=367; the_date=1997-01-01 00:00:00.0\n"
- + "time_id=368; the_date=1997-01-02 00:00:00.0\n"
- + "time_id=369; the_date=1997-01-03 00:00:00.0\n")
+ .returns("time_id=367; the_date=1997-01-01 00:00:00\n"
+ + "time_id=368; the_date=1997-01-02 00:00:00\n"
+ + "time_id=369; the_date=1997-01-03 00:00:00\n")
.explainContains(""
- + "PLAN=EnumerableSort(sort0=[$0], dir0=[ASC])\n"
- + " EnumerableCalc(expr#0..9=[{inputs}], expr#10=[370], expr#11=[<($t0, $t10)], proj#0..1=[{exprs}], $condition=[$t11])\n"
- + " EnumerableTableScan(table=[[foodmart2, time_by_day]])\n\n");
+ + "PLAN=EnumerableCalc(expr#0..9=[{inputs}], expr#10=[370], expr#11=[<($t0, $t10)], proj#0..1=[{exprs}], $condition=[$t11])\n"
+ + " EnumerableTableScan(table=[[foodmart2, time_by_day]])\n\n");
}
@Test public void testWithInsideWhereExists() {
http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/830afef0/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java b/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java
index 0474590..abf85bb 100644
--- a/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java
+++ b/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java
@@ -642,13 +642,13 @@ public class RelBuilderTest {
final String expected = ""
+ "LogicalSort(sort0=[$7], dir0=[DESC], fetch=[10])\n"
+ " LogicalTableScan(table=[[scott, EMP]])\n";
- assertThat(RelOptUtil.toString(root), is(expected));
+ assertThat(str(root), is(expected));
final RelNode root2 =
builder.scan("EMP")
.sortLimit(-1, 10, builder.desc(builder.field("DEPTNO")))
.build();
- assertThat(RelOptUtil.toString(root2), is(expected));
+ assertThat(str(root2), is(expected));
}
/** Tests that a sort on an expression followed by a limit gives the same
@@ -668,7 +668,7 @@ public class RelBuilderTest {
+ " LogicalSort(sort0=[$3], dir0=[DESC], offset=[3], fetch=[10])\n"
+ " LogicalProject(DEPTNO=[$0], DNAME=[$1], LOC=[$2], $f3=[+($0, 1)])\n"
+ " LogicalTableScan(table=[[scott, DEPT]])\n";
- assertThat(RelOptUtil.toString(root), is(expected));
+ assertThat(str(root), is(expected));
final RelNode root2 =
builder.scan("DEPT")
@@ -677,7 +677,7 @@ public class RelBuilderTest {
builder.call(SqlStdOperatorTable.PLUS,
builder.field("DEPTNO"), builder.literal(1))))
.build();
- assertThat(RelOptUtil.toString(root2), is(expected));
+ assertThat(str(root2), is(expected));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/830afef0/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java
----------------------------------------------------------------------
diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java
index 2c362a3..af8d80c 100644
--- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java
+++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java
@@ -189,28 +189,31 @@ public class MongoTable extends AbstractQueryableTable
};
}
- /** Helper method to strip non-numerics from a string
+ /** Helper method to strip non-numerics from a string.
+ *
* <p>Currently used to determine mongod versioning numbers
- * from buildInfo.versionArray for use in aggregate method logic</p>
- * @param valueString
- * @return Integer */
+ * from buildInfo.versionArray for use in aggregate method logic. */
private static Integer parseIntString(String valueString) {
return Integer.parseInt(valueString.replaceAll("[^0-9]", ""));
}
/** Executes an "aggregate" operation for pre-2.6 mongo servers.
+ *
* <p>Return document is limited to 4M or 16M in size depending on
- * version of mongo <p>Helper method for
- * {@link org.apache.calcite.adapter.mongodb.MongoTable#aggregate}
- * </p>
- * @param dbCollection
- * @param first the first aggregate action
- * @param rest the rest of the aggregate actions
- * @return AggregationOutput */
+ * version of mongo.
+
+ * <p>Helper method for
+ * {@link org.apache.calcite.adapter.mongodb.MongoTable#aggregate}.
+ *
+ * @param dbCollection Collection
+ * @param first First aggregate action
+ * @param rest Rest of the aggregate actions
+ * @return Aggregation output
+ */
private AggregationOutput aggregateOldWay(DBCollection dbCollection,
DBObject first, List<DBObject> rest) {
- return dbCollection.aggregate(first, rest
- .toArray(new DBObject[rest.size()]));
+ return dbCollection.aggregate(first,
+ rest.toArray(new DBObject[rest.size()]));
}
/** Implementation of {@link org.apache.calcite.linq4j.Queryable} based on