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

Reduce number of calls to fetch table schema from HMS #1794

Merged
merged 1 commit into from
Nov 23, 2020
Merged
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 @@ -73,10 +73,15 @@ public HiveAuthorizationProvider getAuthorizationProvider() throws HiveException
public void configureInputJobProperties(TableDesc tableDesc, Map<String, String> map) {
Properties props = tableDesc.getProperties();
Table table = Catalogs.loadTable(conf, props);
String schemaJson = SchemaParser.toJson(table.schema());

map.put(InputFormatConfig.TABLE_IDENTIFIER, props.getProperty(Catalogs.NAME));
map.put(InputFormatConfig.TABLE_LOCATION, table.location());
map.put(InputFormatConfig.TABLE_SCHEMA, SchemaParser.toJson(table.schema()));
map.put(InputFormatConfig.TABLE_SCHEMA, schemaJson);

// save schema into table props as well to avoid repeatedly hitting the HMS during serde initializations
// this is an exception to the interface documentation, but it's a safe operation to add this property
props.put(InputFormatConfig.TABLE_SCHEMA, schemaJson);
}

@Override
Expand Down