Skip to content
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

Prevent Hive from returning table handles for Hudi tables #16605

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,9 @@ public HiveTableHandle getTableHandle(ConnectorSession session, SchemaTableName
if (isIcebergTable(table)) {
throw new TrinoException(UNSUPPORTED_TABLE_TYPE, format("Cannot query Iceberg table '%s'", tableName));
}
if (isHudiTable(table)) {
throw new TrinoException(UNSUPPORTED_TABLE_TYPE, format("Cannot query Hudi table '%s'", tableName));
}

// we must not allow system tables due to how permissions are checked in SystemTableAwareAccessControl
if (getSourceTableNameFromSystemTable(systemTableProviders, tableName).isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,8 @@ public static boolean isIcebergTable(Map<String, String> tableParameters)
public static boolean isHudiTable(Table table)
{
requireNonNull(table, "table is null");
String inputFormat = table.getStorage().getStorageFormat().getInputFormat();
@Nullable
String inputFormat = table.getStorage().getStorageFormat().getInputFormatNullable();

return HUDI_PARQUET_INPUT_FORMAT.equals(inputFormat) ||
HUDI_PARQUET_REALTIME_INPUT_FORMAT.equals(inputFormat) ||
Expand Down