Skip to content

Commit ce64da0

Browse files
committed
Lint
Require that newlines in Java string literals are at the end of a fragment. This forces developers to break string literals over several lines, to match the contents of the literals, and helps make long SQL queries and results easier to read and maintain. Disallow '.' at the end of a line of Java code. (If a chain of method calls or field references is broken over multiple lines, each '.' should be at the start of or in the middle of a line.)
1 parent dd49d9f commit ce64da0

File tree

76 files changed

+2719
-1520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2719
-1520
lines changed

arrow/src/test/java/org/apache/calcite/adapter/arrow/ArrowAdapterDataTypesTest.java

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ static void initializeArrowState(@TempDir Path sharedTempDir)
6868
String sql = "select \"tinyIntField\" from arrowdatatype";
6969
String plan = "PLAN=ArrowToEnumerableConverter\n"
7070
+ " ArrowProject(tinyIntField=[$0])\n"
71-
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n\n";
72-
String result = "tinyIntField=0\ntinyIntField=1\n";
71+
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n"
72+
+ "\n";
73+
String result = "tinyIntField=0\n"
74+
+ "tinyIntField=1\n";
7375
CalciteAssert.that()
7476
.with(arrow)
7577
.query(sql)
@@ -82,8 +84,10 @@ static void initializeArrowState(@TempDir Path sharedTempDir)
8284
String sql = "select \"smallIntField\" from arrowdatatype";
8385
String plan = "PLAN=ArrowToEnumerableConverter\n"
8486
+ " ArrowProject(smallIntField=[$1])\n"
85-
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n\n";
86-
String result = "smallIntField=0\nsmallIntField=1\n";
87+
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n"
88+
+ "\n";
89+
String result = "smallIntField=0\n"
90+
+ "smallIntField=1\n";
8791
CalciteAssert.that()
8892
.with(arrow)
8993
.query(sql)
@@ -96,8 +100,10 @@ static void initializeArrowState(@TempDir Path sharedTempDir)
96100
String sql = "select \"intField\" from arrowdatatype";
97101
String plan = "PLAN=ArrowToEnumerableConverter\n"
98102
+ " ArrowProject(intField=[$2])\n"
99-
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n\n";
100-
String result = "intField=0\nintField=1\n";
103+
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n"
104+
+ "\n";
105+
String result = "intField=0\n"
106+
+ "intField=1\n";
101107
CalciteAssert.that()
102108
.with(arrow)
103109
.query(sql)
@@ -110,8 +116,10 @@ static void initializeArrowState(@TempDir Path sharedTempDir)
110116
String sql = "select \"longField\" from arrowdatatype";
111117
String plan = "PLAN=ArrowToEnumerableConverter\n"
112118
+ " ArrowProject(longField=[$5])\n"
113-
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n\n";
114-
String result = "longField=0\nlongField=1\n";
119+
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n"
120+
+ "\n";
121+
String result = "longField=0\n"
122+
+ "longField=1\n";
115123
CalciteAssert.that()
116124
.with(arrow)
117125
.query(sql)
@@ -124,8 +132,10 @@ static void initializeArrowState(@TempDir Path sharedTempDir)
124132
String sql = "select \"floatField\" from arrowdatatype";
125133
String plan = "PLAN=ArrowToEnumerableConverter\n"
126134
+ " ArrowProject(floatField=[$4])\n"
127-
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n\n";
128-
String result = "floatField=0.0\nfloatField=1.0\n";
135+
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n"
136+
+ "\n";
137+
String result = "floatField=0.0\n"
138+
+ "floatField=1.0\n";
129139
CalciteAssert.that()
130140
.with(arrow)
131141
.query(sql)
@@ -138,8 +148,10 @@ static void initializeArrowState(@TempDir Path sharedTempDir)
138148
String sql = "select \"doubleField\" from arrowdatatype";
139149
String plan = "PLAN=ArrowToEnumerableConverter\n"
140150
+ " ArrowProject(doubleField=[$6])\n"
141-
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n\n";
142-
String result = "doubleField=0.0\ndoubleField=1.0\n";
151+
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n"
152+
+ "\n";
153+
String result = "doubleField=0.0\n"
154+
+ "doubleField=1.0\n";
143155
CalciteAssert.that()
144156
.with(arrow)
145157
.query(sql)
@@ -152,8 +164,10 @@ static void initializeArrowState(@TempDir Path sharedTempDir)
152164
String sql = "select \"decimalField\" from arrowdatatype";
153165
String plan = "PLAN=ArrowToEnumerableConverter\n"
154166
+ " ArrowProject(decimalField=[$8])\n"
155-
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n\n";
156-
String result = "decimalField=0.00\ndecimalField=1.00\n";
167+
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n"
168+
+ "\n";
169+
String result = "decimalField=0.00\n"
170+
+ "decimalField=1.00\n";
157171
CalciteAssert.that()
158172
.with(arrow)
159173
.query(sql)
@@ -166,7 +180,8 @@ static void initializeArrowState(@TempDir Path sharedTempDir)
166180
String sql = "select \"dateField\" from arrowdatatype";
167181
String plan = "PLAN=ArrowToEnumerableConverter\n"
168182
+ " ArrowProject(dateField=[$9])\n"
169-
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n\n";
183+
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n"
184+
+ "\n";
170185
String result = "dateField=1970-01-01\n"
171186
+ "dateField=1970-01-02\n";
172187
CalciteAssert.that()
@@ -181,8 +196,11 @@ static void initializeArrowState(@TempDir Path sharedTempDir)
181196
String sql = "select \"booleanField\" from arrowdatatype";
182197
String plan = "PLAN=ArrowToEnumerableConverter\n"
183198
+ " ArrowProject(booleanField=[$7])\n"
184-
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n\n";
185-
String result = "booleanField=null\nbooleanField=true\nbooleanField=false\n";
199+
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n"
200+
+ "\n";
201+
String result = "booleanField=null\n"
202+
+ "booleanField=true\n"
203+
+ "booleanField=false\n";
186204
CalciteAssert.that()
187205
.with(arrow)
188206
.query(sql)
@@ -198,8 +216,10 @@ static void initializeArrowState(@TempDir Path sharedTempDir)
198216
String sql = "select \"decimalField2\" from arrowdatatype";
199217
String plan = "PLAN=ArrowToEnumerableConverter\n"
200218
+ " ArrowProject(decimalField2=[$10])\n"
201-
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n\n";
202-
String result = "decimalField2=20.000\ndecimalField2=21.000\n";
219+
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n"
220+
+ "\n";
221+
String result = "decimalField2=20.000\n"
222+
+ "decimalField2=21.000\n";
203223
CalciteAssert.that()
204224
.with(arrow)
205225
.query(sql)
@@ -212,7 +232,8 @@ static void initializeArrowState(@TempDir Path sharedTempDir)
212232
String sql = "select \"timeField\" from arrowdatatype";
213233
String plan = "PLAN=ArrowToEnumerableConverter\n"
214234
+ " ArrowProject(timeField=[$11])\n"
215-
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n\n";
235+
+ " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])\n"
236+
+ "\n";
216237
String result = "timeField=00:00:00\n"
217238
+ "timeField=00:00:01\n";
218239
CalciteAssert.that()

0 commit comments

Comments
 (0)