Skip to content

Commit

Permalink
DRILL-8442: Fix DeltaRowGroupScan deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
vvysotskyi committed Jun 21, 2023
1 parent 214e188 commit f044a73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<RowGroupReadEntry> rowGroupReadEntries,
@JsonProperty("columns") List<SchemaPath> columns,
Expand Down Expand Up @@ -85,6 +85,11 @@ public DeltaRowGroupScan(String userName,
this.partitions = partitions;
}

@JsonProperty
public StoragePluginConfig getStorageConfig() {
return formatPlugin.getStorageConfig();
}

@JsonProperty
public DeltaFormatPluginConfig getFormatPluginConfig() {
return formatPluginConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit f044a73

Please sign in to comment.