Skip to content

Commit 4ed10a8

Browse files
authored
DRILL-8182: File scan nodes not differentiated by format config (#2583)
1 parent a27eb66 commit 4ed10a8

File tree

39 files changed

+340
-148
lines changed

39 files changed

+340
-148
lines changed

contrib/format-excel/src/test/java/org/apache/drill/exec/store/excel/TestExcelFormat.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,4 +780,34 @@ public void testDuplicateColumnNamesWithExplicitColumnNames() throws Exception {
780780

781781
new RowSetComparison(expected).verifyAndClearAll(results);
782782
}
783+
784+
// DRILL-8182
785+
@Test
786+
public void testTableFuncsThatDifferOnlyByFormatConfig() throws Exception {
787+
String sql = "WITH prod AS (" +
788+
" SELECT id, name FROM table(cp.`excel/test_cross_sheet_join.xlsx` (type=> 'excel', sheetName => 'products'))" +
789+
"), cust AS (" +
790+
" SELECT id, name FROM table(cp.`excel/test_cross_sheet_join.xlsx` (type=> 'excel', sheetName => 'customers'))" +
791+
")" +
792+
"SELECT prod.*, cust.* from prod JOIN cust ON prod.id = cust.id";
793+
794+
RowSet results = client.queryBuilder().sql(sql).rowSet();
795+
796+
TupleMetadata expectedSchema = new SchemaBuilder()
797+
.addNullable("id", MinorType.FLOAT8)
798+
.addNullable("name", MinorType.VARCHAR)
799+
.addNullable("id0", MinorType.FLOAT8)
800+
.addNullable("name0", MinorType.VARCHAR)
801+
.buildSchema();
802+
803+
RowSet expected = new RowSetBuilder(client.allocator(), expectedSchema)
804+
.addRow(1.0, "Doughnut", 1.0, "Alice")
805+
.addRow(2.0, "Coffee", 2.0, "Bob")
806+
.addRow(3.0, "Coke", 3.0, "Carol")
807+
.addRow(4.0, "Cheesecake", 4.0, "Dave")
808+
.addRow(5.0, "Popsicle", 5.0, "Eve")
809+
.build();
810+
811+
new RowSetComparison(expected).verifyAndClearAll(results);
812+
}
783813
}
Binary file not shown.

contrib/storage-cassandra/src/main/java/org/apache/drill/exec/store/cassandra/schema/CassandraDynamicTable.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.apache.calcite.schema.TranslatableTable;
3535
import org.apache.calcite.schema.Wrapper;
3636
import org.apache.drill.exec.planner.logical.DrillTable;
37+
import org.apache.drill.exec.planner.logical.DrillTableSelection;
3738
import org.apache.drill.exec.store.StoragePlugin;
3839

3940
import java.lang.reflect.Type;
@@ -44,7 +45,7 @@ public class CassandraDynamicTable extends DrillTable implements TranslatableTab
4445

4546
private final CassandraTable table;
4647

47-
public CassandraDynamicTable(StoragePlugin plugin, String storageEngineName, Object selection, CassandraTable table) {
48+
public CassandraDynamicTable(StoragePlugin plugin, String storageEngineName, DrillTableSelection selection, CassandraTable table) {
4849
super(storageEngineName, plugin, selection);
4950
this.table = table;
5051
}

contrib/storage-druid/src/main/java/org/apache/drill/exec/store/druid/DruidScanSpec.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
import com.fasterxml.jackson.annotation.JsonCreator;
2222
import com.fasterxml.jackson.annotation.JsonProperty;
2323
import org.apache.drill.common.PlanStringBuilder;
24+
import org.apache.drill.exec.planner.logical.DrillTableSelection;
2425
import org.apache.drill.exec.store.druid.common.DruidFilter;
2526

26-
public class DruidScanSpec {
27+
public class DruidScanSpec implements DrillTableSelection {
2728

2829
private final String dataSourceName;
2930
private final long dataSourceSize;
@@ -84,4 +85,9 @@ public String toString() {
8485
.field("filter", filter)
8586
.toString();
8687
}
88+
89+
@Override
90+
public String digest() {
91+
return toString();
92+
}
8793
}

contrib/storage-elasticsearch/src/main/java/org/apache/drill/exec/store/elasticsearch/schema/ElasticsearchDynamicTable.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.apache.calcite.schema.Table;
3232
import org.apache.calcite.schema.TranslatableTable;
3333
import org.apache.calcite.schema.Wrapper;
34+
import org.apache.drill.exec.planner.logical.DrillTableSelection;
3435
import org.apache.drill.exec.planner.logical.DynamicDrillTable;
3536
import org.apache.drill.exec.store.StoragePlugin;
3637

@@ -40,7 +41,7 @@ public class ElasticsearchDynamicTable extends DynamicDrillTable implements Tran
4041

4142
private final ElasticsearchTable table;
4243

43-
public ElasticsearchDynamicTable(StoragePlugin plugin, String storageEngineName, Object selection, Table table) {
44+
public ElasticsearchDynamicTable(StoragePlugin plugin, String storageEngineName, DrillTableSelection selection, Table table) {
4445
super(plugin, storageEngineName, selection);
4546
this.table = (ElasticsearchTable) table;
4647
}

contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/AbstractHBaseDrillTable.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.apache.calcite.sql.type.SqlTypeName;
2323
import org.apache.drill.common.exceptions.UserException;
2424
import org.apache.drill.exec.planner.logical.DrillTable;
25+
import org.apache.drill.exec.planner.logical.DrillTableSelection;
2526
import org.apache.drill.exec.store.StoragePlugin;
2627
import org.apache.hadoop.hbase.TableName;
2728
import org.apache.hadoop.hbase.client.Connection;
@@ -41,7 +42,7 @@ public abstract class AbstractHBaseDrillTable extends DrillTable {
4142

4243
protected HTableDescriptor tableDesc;
4344

44-
public AbstractHBaseDrillTable(String storageEngineName, StoragePlugin plugin, Object selection) {
45+
public AbstractHBaseDrillTable(String storageEngineName, StoragePlugin plugin, DrillTableSelection selection) {
4546
super(storageEngineName, plugin, selection);
4647
}
4748

contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBaseScanSpec.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
package org.apache.drill.exec.store.hbase;
1919

2020

21+
import org.apache.drill.common.PlanStringBuilder;
22+
import org.apache.drill.exec.planner.logical.DrillTableSelection;
2123
import org.apache.hadoop.hbase.HConstants;
2224
import org.apache.hadoop.hbase.filter.Filter;
2325
import org.apache.hadoop.hbase.util.Bytes;
@@ -26,7 +28,7 @@
2628
import com.fasterxml.jackson.annotation.JsonIgnore;
2729
import com.fasterxml.jackson.annotation.JsonProperty;
2830

29-
public class HBaseScanSpec {
31+
public class HBaseScanSpec implements DrillTableSelection {
3032

3133
protected String tableName;
3234
protected byte[] startRow;
@@ -87,10 +89,16 @@ public byte[] getSerializedFilter() {
8789

8890
@Override
8991
public String toString() {
90-
return "HBaseScanSpec [tableName=" + tableName
91-
+ ", startRow=" + (startRow == null ? null : Bytes.toStringBinary(startRow))
92-
+ ", stopRow=" + (stopRow == null ? null : Bytes.toStringBinary(stopRow))
93-
+ ", filter=" + (filter == null ? null : filter.toString())
94-
+ "]";
92+
return new PlanStringBuilder(this)
93+
.field("tableName", tableName)
94+
.field("startRow", startRow == null ? null : Bytes.toStringBinary(startRow))
95+
.field("stopRow", stopRow == null ? null : Bytes.toStringBinary(stopRow))
96+
.field("filter", filter == null ? null : filter.toString())
97+
.toString();
98+
}
99+
100+
@Override
101+
public String digest() {
102+
return toString();
95103
}
96104
}

contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestHBaseFilterPushDown.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void testFilterPushDownRowKeyEqual() throws Exception {
3838

3939
runHBaseSQLVerifyCount(sql, 1);
4040

41-
final String[] expectedPlan = {".*startRow=b4, stopRow=b4\\\\x00, filter=null.*"};
41+
final String[] expectedPlan = {".*startRow=\"b4\", stopRow=\"b4\\\\x00\".*"};
4242
final String[] excludedPlan ={};
4343
final String sqlHBase = canonizeHBaseSQL(sql);
4444
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -56,7 +56,7 @@ public void testFilterPushDownRowKeyNotEqual() throws Exception {
5656

5757
runHBaseSQLVerifyCount(sql, 7);
5858

59-
final String[] expectedPlan = {".*startRow=, stopRow=, filter=RowFilter \\(NOT_EQUAL, b4\\).*"};
59+
final String[] expectedPlan = {".*startRow=\"\", stopRow=\"\", filter=\"RowFilter \\(NOT_EQUAL, b4\\)\".*"};
6060
final String[] excludedPlan ={};
6161
final String sqlHBase = canonizeHBaseSQL(sql);
6262
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -74,7 +74,7 @@ public void testFilterPushDownRowKeyEqualWithItem() throws Exception {
7474

7575
runHBaseSQLVerifyCount(sql, 1);
7676

77-
final String[] expectedPlan = {".*startRow=b4, stopRow=b4\\\\x00, filter=null.*"};
77+
final String[] expectedPlan = {".*startRow=\"b4\", stopRow=\"b4\\\\x00\".*"};
7878
final String[] excludedPlan ={".*startRow=null, stopRow=null.*"};
7979
final String sqlHBase = canonizeHBaseSQL(sql);
8080
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -489,7 +489,7 @@ public void testFilterPushDownRowKeyLike() throws Exception {
489489

490490
runHBaseSQLVerifyCount(sql, 21);
491491

492-
final String[] expectedPlan = {".*filter=FilterList OR.*EQUAL.*EQUAL.*"};
492+
final String[] expectedPlan = {".*filter=\"FilterList OR.*EQUAL.*EQUAL.*\""};
493493
final String[] excludedPlan ={};
494494
final String sqlHBase = canonizeHBaseSQL(sql);
495495
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -507,7 +507,7 @@ public void testFilterPushDownRowKeyLikeWithEscape() throws Exception {
507507

508508
runHBaseSQLVerifyCount(sql, 2);
509509

510-
final String[] expectedPlan = {".*startRow=\\%_AS_PREFIX_, stopRow=\\%_AS_PREFIX`, filter=RowFilter.*EQUAL.*"};
510+
final String[] expectedPlan = {".*startRow=\"\\%_AS_PREFIX_\", stopRow=\"\\%_AS_PREFIX`\", filter=\"RowFilter.*EQUAL.*\""};
511511
final String[] excludedPlan ={};
512512
final String sqlHBase = canonizeHBaseSQL(sql);
513513
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -525,7 +525,7 @@ public void testFilterPushDownRowKeyRangeAndColumnValueLike() throws Exception {
525525

526526
runHBaseSQLVerifyCount(sql, 22);
527527

528-
final String[] expectedPlan = {".*startRow=07, stopRow=09, filter=FilterList AND.*RowFilter \\(GREATER_OR_EQUAL, 07\\), RowFilter \\(LESS, 09\\), SingleColumnValueFilter \\(f, c, EQUAL.*"};
528+
final String[] expectedPlan = {".*startRow=\"07\", stopRow=\"09\", filter=\"FilterList AND.*RowFilter \\(GREATER_OR_EQUAL, 07\\), RowFilter \\(LESS, 09\\), SingleColumnValueFilter \\(f, c, EQUAL.*\""};
529529
final String[] excludedPlan ={};
530530
final String sqlHBase = canonizeHBaseSQL(sql);
531531
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -543,7 +543,7 @@ public void testFilterPushDownRowKeyGreaterThan() throws Exception {
543543

544544
runHBaseSQLVerifyCount(sql, 4);
545545

546-
final String[] expectedPlan = {".*startRow=b4\\\\x00.*stopRow=,.*"};
546+
final String[] expectedPlan = {".*startRow=\"b4\\\\x00\", stopRow=\"\".*"};
547547
final String[] excludedPlan ={};
548548
final String sqlHBase = canonizeHBaseSQL(sql);
549549
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -561,7 +561,7 @@ public void testFilterPushDownRowKeyGreaterThanWithItem() throws Exception {
561561

562562
runHBaseSQLVerifyCount(sql, 2);
563563

564-
final String[] expectedPlan = {".*startRow=b4\\\\x00.*stopRow=, filter=null.*"};
564+
final String[] expectedPlan = {".*startRow=\"b4\\\\x00\".*stopRow=.*"};
565565
final String[] excludedPlan ={};
566566
final String sqlHBase = canonizeHBaseSQL(sql);
567567
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -579,7 +579,7 @@ public void testFilterPushDownRowKeyBetween() throws Exception {
579579

580580
runHBaseSQLVerifyCount(sql, 3);
581581

582-
final String[] expectedPlan = {".*startRow=a2, stopRow=b4\\\\x00, filter=FilterList AND.*GREATER_OR_EQUAL, a2.*LESS_OR_EQUAL, b4.*"};
582+
final String[] expectedPlan = {".*startRow=\"a2\", stopRow=\"b4\\\\x00\", filter=\"FilterList AND.*GREATER_OR_EQUAL, a2.*LESS_OR_EQUAL, b4.*\""};
583583
final String[] excludedPlan ={};
584584
final String sqlHBase = canonizeHBaseSQL(sql);
585585
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -597,7 +597,7 @@ public void testFilterPushDownRowKeyBetweenWithItem() throws Exception {
597597

598598
runHBaseSQLVerifyCount(sql, 3);
599599

600-
final String[] expectedPlan = {".*startRow=a2, stopRow=b4\\\\x00, filter=FilterList AND.*GREATER_OR_EQUAL, a2.*LESS_OR_EQUAL, b4.*"};
600+
final String[] expectedPlan = {".*startRow=\"a2\", stopRow=\"b4\\\\x00\", filter=\"FilterList AND.*GREATER_OR_EQUAL, a2.*LESS_OR_EQUAL, b4.*\""};
601601
final String[] excludedPlan ={};
602602
final String sqlHBase = canonizeHBaseSQL(sql);
603603
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -615,7 +615,7 @@ public void testFilterPushDownMultiColumns() throws Exception {
615615

616616
runHBaseSQLVerifyCount(sql, 5);
617617

618-
final String[] expectedPlan = {".*startRow=, stopRow=, filter=FilterList OR.*GREATER_OR_EQUAL, b5.*LESS_OR_EQUAL, a2.*"};
618+
final String[] expectedPlan = {".*startRow=\"\", stopRow=\"\", filter=\"FilterList OR.*GREATER_OR_EQUAL, b5.*LESS_OR_EQUAL, a2.*\""};
619619
final String[] excludedPlan ={};
620620
final String sqlHBase = canonizeHBaseSQL(sql);
621621
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -631,7 +631,7 @@ public void testFilterPushDownMultiColumnsWithItem() throws Exception {
631631
+ "WHERE\n"
632632
+ " (row_key >= 'b5' OR row_key <= 'a2') AND (t.f.c1 >= '1' OR t.f.c1 is null)";
633633

634-
final String[] expectedPlan = {".*startRow=, stopRow=, filter=FilterList OR.*GREATER_OR_EQUAL, b5.*LESS_OR_EQUAL, a2.*"};
634+
final String[] expectedPlan = {".*startRow=\"\", stopRow=\"\", filter=\"FilterList OR.*GREATER_OR_EQUAL, b5.*LESS_OR_EQUAL, a2.*\""};
635635
final String[] excludedPlan ={};
636636
final String sqlHBase = canonizeHBaseSQL(sql);
637637
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -649,7 +649,7 @@ public void testFilterPushDownConvertExpression() throws Exception {
649649

650650
runHBaseSQLVerifyCount(sql, 4);
651651

652-
final String[] expectedPlan = {".*startRow=b4\\\\x00, stopRow=,.*"};
652+
final String[] expectedPlan = {".*startRow=\"b4\\\\x00\", stopRow=\"\".*"};
653653
final String[] excludedPlan ={};
654654
final String sqlHBase = canonizeHBaseSQL(sql);
655655
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -667,7 +667,7 @@ public void testFilterPushDownConvertExpressionWithItem() throws Exception {
667667

668668
runHBaseSQLVerifyCount(sql, 2);
669669

670-
final String[] expectedPlan = {".*startRow=b4\\\\x00, stopRow=,.*"};
670+
final String[] expectedPlan = {".*startRow=\"b4\\\\x00\", stopRow=\"\".*"};
671671
final String[] excludedPlan ={};
672672
final String sqlHBase = canonizeHBaseSQL(sql);
673673
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -698,7 +698,7 @@ public void testFilterPushDownRowKeyLessThanOrEqualTo() throws Exception {
698698

699699
runHBaseSQLVerifyCount(sql, 4);
700700

701-
final String[] expectedPlan = {".*startRow=, stopRow=b4\\\\x00, filter=null.*"};
701+
final String[] expectedPlan = {".*startRow=\"\", stopRow=\"b4\\\\x00\".*"};
702702
final String[] excludedPlan ={};
703703
final String sqlHBase = canonizeHBaseSQL(sql);
704704
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -716,7 +716,7 @@ public void testFilterPushDownRowKeyLessThanOrEqualToWithItem() throws Exception
716716

717717
runHBaseSQLVerifyCount(sql, 4);
718718

719-
final String[] expectedPlan = {".*startRow=, stopRow=b4\\\\x00, filter=null.*"};
719+
final String[] expectedPlan = {".*startRow=\"\", stopRow=\"b4\\\\x00\".*"};
720720
final String[] excludedPlan ={};
721721
final String sqlHBase = canonizeHBaseSQL(sql);
722722
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -734,7 +734,7 @@ public void testFilterPushDownOrRowKeyEqual() throws Exception {
734734

735735
runHBaseSQLVerifyCount(sql, 2);
736736

737-
final String[] expectedPlan = {".*startRow=a2, stopRow=b4\\\\x00, filter=FilterList OR \\(2/2\\): \\[RowFilter \\(EQUAL, b4\\), RowFilter \\(EQUAL, a2\\).*"};
737+
final String[] expectedPlan = {".*startRow=\"a2\", stopRow=\"b4\\\\x00\", filter=\"FilterList OR \\(2/2\\): \\[RowFilter \\(EQUAL, b4\\), RowFilter \\(EQUAL, a2\\).*\""};
738738
final String[] excludedPlan ={};
739739
final String sqlHBase = canonizeHBaseSQL(sql);
740740
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -753,7 +753,7 @@ public void testFilterPushDownOrRowKeyInPred() throws Exception {
753753

754754
runHBaseSQLVerifyCount(sql, 2);
755755

756-
final String[] expectedPlan = {".*startRow=a2, stopRow=b4\\\\x00, filter=FilterList OR \\(2/2\\): \\[RowFilter \\(EQUAL, b4\\), RowFilter \\(EQUAL, a2\\).*"};
756+
final String[] expectedPlan = {".*startRow=\"a2\", stopRow=\"b4\\\\x00\", filter=\"FilterList OR \\(2/2\\): \\[RowFilter \\(EQUAL, b4\\), RowFilter \\(EQUAL, a2\\).*\""};
757757
final String[] excludedPlan ={};
758758
final String sqlHBase = canonizeHBaseSQL(sql);
759759
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -772,7 +772,7 @@ public void testFilterPushDownOrRowKeyEqualRangePred() throws Exception {
772772

773773
runHBaseSQLVerifyCount(sql, 3);
774774

775-
final String[] expectedPlan = {".*startRow=a2, stopRow=b6\\\\x00, filter=FilterList OR \\(2/2\\): \\[RowFilter \\(EQUAL, a2\\), FilterList AND \\(2/2\\): \\[RowFilter \\(GREATER_OR_EQUAL, b5\\), RowFilter \\(LESS_OR_EQUAL, b6.*"};
775+
final String[] expectedPlan = {".*startRow=\"a2\", stopRow=\"b6\\\\x00\", filter=\"FilterList OR \\(2/2\\): \\[RowFilter \\(EQUAL, a2\\), FilterList AND \\(2/2\\): \\[RowFilter \\(GREATER_OR_EQUAL, b5\\), RowFilter \\(LESS_OR_EQUAL, b6.*\""};
776776
final String[] excludedPlan ={};
777777
final String sqlHBase = canonizeHBaseSQL(sql);
778778
PlanTestBase.testPlanMatchingPatterns(sqlHBase, expectedPlan, excludedPlan);
@@ -808,9 +808,9 @@ public void testConvertFromPushDownWithView() throws Exception {
808808

809809
String query = "select d from dfs.tmp.pd_view where d > date '2015-06-13' and d < DATE '2015-06-18'";
810810
String[] expectedPlan = {
811-
"startRow=\\\\x00\\\\x00\\\\x01M\\\\xEF\\]\\\\xA0\\\\x00, " +
812-
"stopRow=\\\\x00\\\\x00\\\\x01N\\\\x03\\\\xF7\\\\x10\\\\x00, " +
813-
"filter=null"};
811+
"startRow=\"\\\\x00\\\\x00\\\\x01M\\\\xEF\\]\\\\xA0\\\\x00\", " +
812+
"stopRow=\"\\\\x00\\\\x00\\\\x01N\\\\x03\\\\xF7\\\\x10\\\\x00\""
813+
};
814814
String[] excludedPlan ={"Filter\\("};
815815
PlanTestBase.testPlanMatchingPatterns(query, expectedPlan, excludedPlan);
816816

contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveReadEntry.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121

2222
import org.apache.calcite.schema.Schema.TableType;
2323

24+
import org.apache.drill.common.PlanStringBuilder;
25+
import org.apache.drill.exec.planner.logical.DrillTableSelection;
2426
import org.apache.drill.exec.store.hive.HiveTableWrapper.HivePartitionWrapper;
2527

2628
import com.fasterxml.jackson.annotation.JsonCreator;
2729
import com.fasterxml.jackson.annotation.JsonIgnore;
2830
import com.fasterxml.jackson.annotation.JsonProperty;
2931
import org.apache.drill.shaded.guava.com.google.common.collect.Lists;
3032

31-
public class HiveReadEntry {
33+
public class HiveReadEntry implements DrillTableSelection {
3234

3335
@JsonProperty("table")
3436
public HiveTableWrapper table;
@@ -93,5 +95,18 @@ public String getPartitionLocation(HivePartitionWrapper partition) {
9395

9496
return partitionPath;
9597
}
98+
99+
@Override
100+
public String toString() {
101+
return new PlanStringBuilder(this)
102+
.field("tableName", table)
103+
.field("partitions", partitions)
104+
.toString();
105+
}
106+
107+
@Override
108+
public String digest() {
109+
return toString();
110+
}
96111
}
97112

contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpScanSpec.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
import com.fasterxml.jackson.annotation.JsonTypeName;
2525
import org.apache.drill.common.PlanStringBuilder;
2626
import org.apache.drill.exec.oauth.PersistentTokenTable;
27+
import org.apache.drill.exec.planner.logical.DrillTableSelection;
2728
import org.apache.drill.exec.store.StoragePluginRegistry;
2829

2930
@JsonTypeName("http-scan-spec")
30-
public class HttpScanSpec {
31+
public class HttpScanSpec implements DrillTableSelection {
3132

3233
private final String pluginName;
3334
private final String connectionName;
@@ -109,4 +110,9 @@ public String toString() {
109110
.field("queryUserName", queryUserName)
110111
.toString();
111112
}
113+
114+
@Override
115+
public String digest() {
116+
return toString();
117+
}
112118
}

0 commit comments

Comments
 (0)