-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add hive configs for supported read and write formats #25147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,6 +151,7 @@ public class HiveSplitManager | |
private final CacheQuotaRequirementProvider cacheQuotaRequirementProvider; | ||
private final HiveEncryptionInformationProvider encryptionInformationProvider; | ||
private final PartitionSkippabilityChecker partitionSkippabilityChecker; | ||
private final List<String> readFormats; | ||
|
||
@Inject | ||
public HiveSplitManager( | ||
|
@@ -181,7 +182,8 @@ public HiveSplitManager( | |
hiveClientConfig.getRecursiveDirWalkerEnabled(), | ||
cacheQuotaRequirementProvider, | ||
encryptionInformationProvider, | ||
partitionSkippabilityChecker); | ||
partitionSkippabilityChecker, | ||
hiveClientConfig.getReadFormats()); | ||
} | ||
|
||
public HiveSplitManager( | ||
|
@@ -200,7 +202,8 @@ public HiveSplitManager( | |
boolean recursiveDfsWalkerEnabled, | ||
CacheQuotaRequirementProvider cacheQuotaRequirementProvider, | ||
HiveEncryptionInformationProvider encryptionInformationProvider, | ||
PartitionSkippabilityChecker partitionSkippabilityChecker) | ||
PartitionSkippabilityChecker partitionSkippabilityChecker, | ||
List<String> readFormats) | ||
{ | ||
this.hiveTransactionManager = requireNonNull(hiveTransactionManager, "hiveTransactionManager is null"); | ||
this.namenodeStats = requireNonNull(namenodeStats, "namenodeStats is null"); | ||
|
@@ -219,6 +222,7 @@ public HiveSplitManager( | |
this.cacheQuotaRequirementProvider = requireNonNull(cacheQuotaRequirementProvider, "cacheQuotaRequirementProvider is null"); | ||
this.encryptionInformationProvider = requireNonNull(encryptionInformationProvider, "encryptionInformationProvider is null"); | ||
this.partitionSkippabilityChecker = requireNonNull(partitionSkippabilityChecker, "partitionSkippabilityChecker is null"); | ||
this.readFormats = requireNonNull(readFormats, "readFormats is null"); | ||
} | ||
|
||
@Override | ||
|
@@ -250,6 +254,20 @@ public ConnectorSplitSource getSplits( | |
session.getRuntimeStats()); | ||
Table table = layout.getTable(metastore, metastoreContext); | ||
|
||
if (!readFormats.isEmpty()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't think we should delay checking the tablelayout for storageFormat until split scheduling. We want to avoid scheduling the fragment at all. Is it possible to do this earlier in BasePlanFragmenter @tdcmeehan : wdyt ? |
||
StorageFormat storageFormat = table.getStorage().getStorageFormat(); | ||
Optional<HiveStorageFormat> hiveStorageFormat = getHiveStorageFormat(storageFormat); | ||
pramodsatya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (hiveStorageFormat.isPresent()) { | ||
if (!readFormats.contains(hiveStorageFormat.get().toString())) { | ||
throw new HiveNotReadableException(tableName, Optional.empty(), | ||
format("File format %s not supported for read operation.", hiveStorageFormat.get().toString())); | ||
} | ||
} | ||
else { | ||
throw new HiveNotReadableException(tableName, Optional.empty(), "Storage format is null."); | ||
} | ||
} | ||
|
||
if (!isOfflineDataDebugModeEnabled(session)) { | ||
// verify table is not marked as non-readable | ||
String tableNotReadable = table.getParameters().get(OBJECT_NOT_READABLE); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even this code is called during scheduling stage executions... Its worthwhile only if the check is done sooner in logical planning or BasePlanFragmenter.
I think extractHiveStorageFormat from a table can be called much sooner. Can you investigate further ?