From f044a73f456b0ebb4e3a14c534e78d77b7b71507 Mon Sep 17 00:00:00 2001 From: Volodymyr Vysotskyi Date: Wed, 21 Jun 2023 20:24:31 +0300 Subject: [PATCH] DRILL-8442: Fix DeltaRowGroupScan deserialization --- .../apache/drill/exec/store/delta/DeltaRowGroupScan.java | 7 ++++++- .../apache/drill/exec/store/delta/DeltaQueriesTest.java | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/contrib/format-deltalake/src/main/java/org/apache/drill/exec/store/delta/DeltaRowGroupScan.java b/contrib/format-deltalake/src/main/java/org/apache/drill/exec/store/delta/DeltaRowGroupScan.java index 5645c3f5594..df675dfa329 100644 --- a/contrib/format-deltalake/src/main/java/org/apache/drill/exec/store/delta/DeltaRowGroupScan.java +++ b/contrib/format-deltalake/src/main/java/org/apache/drill/exec/store/delta/DeltaRowGroupScan.java @@ -53,7 +53,7 @@ public class DeltaRowGroupScan extends AbstractParquetRowGroupScan { @JsonCreator public DeltaRowGroupScan(@JacksonInject StoragePluginRegistry registry, @JsonProperty("userName") String userName, - @JsonProperty("storage") StoragePluginConfig storageConfig, + @JsonProperty("storageConfig") StoragePluginConfig storageConfig, @JsonProperty("formatPluginConfig") FormatPluginConfig formatPluginConfig, @JsonProperty("rowGroupReadEntries") List rowGroupReadEntries, @JsonProperty("columns") List columns, @@ -85,6 +85,11 @@ public DeltaRowGroupScan(String userName, this.partitions = partitions; } + @JsonProperty + public StoragePluginConfig getStorageConfig() { + return formatPlugin.getStorageConfig(); + } + @JsonProperty public DeltaFormatPluginConfig getFormatPluginConfig() { return formatPluginConfig; diff --git a/contrib/format-deltalake/src/test/java/org/apache/drill/exec/store/delta/DeltaQueriesTest.java b/contrib/format-deltalake/src/test/java/org/apache/drill/exec/store/delta/DeltaQueriesTest.java index fb98fec5e28..326d918daef 100644 --- a/contrib/format-deltalake/src/test/java/org/apache/drill/exec/store/delta/DeltaQueriesTest.java +++ b/contrib/format-deltalake/src/test/java/org/apache/drill/exec/store/delta/DeltaQueriesTest.java @@ -19,6 +19,7 @@ import org.apache.drill.common.logical.FormatPluginConfig; import org.apache.drill.common.logical.security.PlainCredentialsProvider; +import org.apache.drill.exec.ExecConstants; import org.apache.drill.exec.store.StoragePluginRegistry; import org.apache.drill.exec.store.delta.format.DeltaFormatPluginConfig; import org.apache.drill.exec.store.dfs.FileSystemConfig; @@ -61,7 +62,8 @@ public static void setUpBeforeClass() throws Exception { @Test public void testSerDe() throws Exception { - String plan = queryBuilder().sql("select * from dfs.`data-reader-partition-values`").explainJson(); + client.alterSession(ExecConstants.SLICE_TARGET, 1); + String plan = queryBuilder().sql("select * from table(dfs.`data-reader-partition-values` (type => 'delta'))").explainJson(); long count = queryBuilder().physical(plan).run().recordCount(); assertEquals(3, count); }