calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcama...@apache.org
Subject [34/50] [abbrv] calcite git commit: Fix Windows issues (line endings and checkstyle suppressions)
Date Wed, 11 Nov 2015 12:25:40 GMT
Fix Windows issues (line endings and checkstyle suppressions)


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/4c3eb7cd
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/4c3eb7cd
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/4c3eb7cd

Branch: refs/heads/branch-release
Commit: 4c3eb7cdc4f59509799511597ee2cdf10cd1f548
Parents: 5c45547
Author: Julian Hyde <jhyde@apache.org>
Authored: Fri Oct 30 09:45:26 2015 -0700
Committer: Julian Hyde <jhyde@apache.org>
Committed: Fri Oct 30 09:45:26 2015 -0700

----------------------------------------------------------------------
 .../apache/calcite/test/PigRelBuilderTest.java  | 23 +++++++++++++-------
 .../java/org/apache/calcite/test/Fluent.java    |  7 +++---
 src/main/config/checkstyle/suppressions.xml     |  4 ++--
 3 files changed, 21 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/4c3eb7cd/core/src/test/java/org/apache/calcite/test/PigRelBuilderTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/PigRelBuilderTest.java b/core/src/test/java/org/apache/calcite/test/PigRelBuilderTest.java
index c77b37d..d1b9f33 100644
--- a/core/src/test/java/org/apache/calcite/test/PigRelBuilderTest.java
+++ b/core/src/test/java/org/apache/calcite/test/PigRelBuilderTest.java
@@ -20,6 +20,7 @@ import org.apache.calcite.plan.RelOptUtil;
 import org.apache.calcite.rel.RelNode;
 import org.apache.calcite.tools.Frameworks;
 import org.apache.calcite.tools.PigRelBuilder;
+import org.apache.calcite.util.Util;
 
 import org.junit.Test;
 
@@ -35,6 +36,11 @@ public class PigRelBuilderTest {
     return RelBuilderTest.config();
   }
 
+  /** Converts a relational expression to a sting with linux line-endings. */
+  private String str(RelNode r) {
+    return Util.toLinux(RelOptUtil.toString(r));
+  }
+
   @Test public void testScan() {
     // Equivalent SQL:
     //   SELECT *
@@ -43,7 +49,7 @@ public class PigRelBuilderTest {
     final RelNode root = builder
         .scan("EMP")
         .build();
-    assertThat(RelOptUtil.toString(root),
+    assertThat(str(root),
         is("LogicalTableScan(table=[[scott, EMP]])\n"));
   }
 
@@ -61,7 +67,7 @@ public class PigRelBuilderTest {
         .build();
     final String plan = "LogicalAggregate(group=[{0, 1, 2, 3, 4, 5, 6, 7}])\n"
         + "  LogicalTableScan(table=[[scott, EMP]])\n";
-    assertThat(RelOptUtil.toString(root), is(plan));
+    assertThat(str(root), is(plan));
   }
 
   @Test public void testFilter() {
@@ -74,12 +80,13 @@ public class PigRelBuilderTest {
         .load("EMP.csv", null, null)
         .filter(builder.isNotNull(builder.field("MGR")))
         .build();
-    assertThat(RelOptUtil.toString(root),
-        is("LogicalFilter(condition=[IS NOT NULL($3)])\n"
-            + "  LogicalTableScan(table=[[scott, EMP]])\n"));
+    final String plan = "LogicalFilter(condition=[IS NOT NULL($3)])\n"
+        + "  LogicalTableScan(table=[[scott, EMP]])\n";
+    assertThat(str(root), is(plan));
   }
 
   @Test public void testForeach() {}
+
   @Test public void testGroup() {
     // Syntax:
     //   alias = GROUP alias { ALL | BY expression}
@@ -96,7 +103,7 @@ public class PigRelBuilderTest {
         + "LogicalAggregate(group=[{2, 7}], EMP=[COLLECT($8)])\n"
         + "  LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], SAL=[$5],
COMM=[$6], DEPTNO=[$7], $f8=[ROW($0, $1, $2, $3, $4, $5, $6, $7)])\n"
         + "    LogicalTableScan(table=[[scott, EMP]])\n";
-    assertThat(RelOptUtil.toString(root), is(plan));
+    assertThat(str(root), is(plan));
   }
 
   @Test public void testGroup2() {
@@ -115,7 +122,7 @@ public class PigRelBuilderTest {
         + "    LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4],
SAL=[$5], COMM=[$6], DEPTNO=[$7], $f8=[ROW($0, $1, $2, $3, $4, $5, $6, $7)])\n      LogicalTableScan(table=[[scott,
EMP]])\n  LogicalAggregate(group=[{0}], DEPT=[COLLECT($3)])\n"
         + "    LogicalProject(DEPTNO=[$0], DNAME=[$1], LOC=[$2], $f3=[ROW($0, $1, $2)])\n"
         + "      LogicalTableScan(table=[[scott, DEPT]])\n";
-    assertThat(RelOptUtil.toString(root), is(plan));
+    assertThat(str(root), is(plan));
   }
 
   @Test public void testImport() {}
@@ -132,7 +139,7 @@ public class PigRelBuilderTest {
     final RelNode root = builder
         .load("EMP.csv", null, null)
         .build();
-    assertThat(RelOptUtil.toString(root),
+    assertThat(str(root),
         is("LogicalTableScan(table=[[scott, EMP]])\n"));
   }
 

http://git-wip-us.apache.org/repos/asf/calcite/blob/4c3eb7cd/piglet/src/test/java/org/apache/calcite/test/Fluent.java
----------------------------------------------------------------------
diff --git a/piglet/src/test/java/org/apache/calcite/test/Fluent.java b/piglet/src/test/java/org/apache/calcite/test/Fluent.java
index 6cfa410..021f642 100644
--- a/piglet/src/test/java/org/apache/calcite/test/Fluent.java
+++ b/piglet/src/test/java/org/apache/calcite/test/Fluent.java
@@ -22,6 +22,7 @@ import org.apache.calcite.piglet.parser.ParseException;
 import org.apache.calcite.piglet.parser.PigletParser;
 import org.apache.calcite.plan.RelOptUtil;
 import org.apache.calcite.tools.PigRelBuilder;
+import org.apache.calcite.util.Util;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Lists;
@@ -52,7 +53,7 @@ class Fluent {
     final PigRelBuilder builder =
         PigRelBuilder.create(PigRelBuilderTest.config().build());
     new Handler(builder).handle(program);
-    assertThat(RelOptUtil.toString(builder.peek()), is(expected));
+    assertThat(Util.toLinux(RelOptUtil.toString(builder.peek())), is(expected));
     return this;
   }
 
@@ -99,13 +100,13 @@ class Fluent {
         PigRelBuilder.create(PigRelBuilderTest.config().build());
     final StringWriter sw = new StringWriter();
     new CalciteHandler(builder, sw).handle(program);
-    checker.apply(sw.toString());
+    checker.apply(Util.toLinux(sw.toString()));
     return this;
   }
 
   public Fluent parseContains(String expected) throws ParseException {
     final Ast.Program program = parseProgram(pig);
-    assertThat(Ast.toString(program), is(expected));
+    assertThat(Util.toLinux(Ast.toString(program)), is(expected));
     return this;
   }
 }

http://git-wip-us.apache.org/repos/asf/calcite/blob/4c3eb7cd/src/main/config/checkstyle/suppressions.xml
----------------------------------------------------------------------
diff --git a/src/main/config/checkstyle/suppressions.xml b/src/main/config/checkstyle/suppressions.xml
index 4086a9e..e4aaead 100644
--- a/src/main/config/checkstyle/suppressions.xml
+++ b/src/main/config/checkstyle/suppressions.xml
@@ -23,11 +23,11 @@ limitations under the License.
   <suppress checks="Header" files="CalciteResource.properties"/>
   <suppress checks=".*" files="org-apache-calcite-jdbc.properties"/>
   <suppress checks=".*" files="Foo.java"/>
-  <suppress checks=".*" files=".*/target/maven-archiver/pom.properties"/>
+  <suppress checks=".*" files=".*[/\\]target[/\\]maven-archiver[/\\]pom.properties"/>
   <suppress checks=".*" files="git.properties"/>
   <suppress checks=".*" files="trace.properties"/>
   <suppress checks=".*" files="release.properties"/>
-  <suppress checks=".*" files="avatica/src/main/java/org/apache/calcite/avatica/proto"/>
+  <suppress checks=".*" files="avatica[/\\]src[/\\]main[/\\]java[/\\]org[/\\]apache[/\\]calcite[/\\]avatica[/\\]proto"/>
 
   <!-- This file triggers https://github.com/checkstyle/checkstyle/issues/92,
        through no fault of its own. -->


Mime
View raw message