Skip to content

HIVE-18842#696

Closed
jcamachor wants to merge 1 commit intoapache:masterfrom
jcamachor:HIVE-18842
Closed

HIVE-18842#696
jcamachor wants to merge 1 commit intoapache:masterfrom
jcamachor:HIVE-18842

Conversation

@jcamachor
Copy link
Contributor

No description provided.

private Map<String, String> serdeProps; // only used for materialized views
private Set<String> tablesUsed; // only used for materialized views
private List<String> sortColNames; // only used for materialized views
private List<FieldSchema> sortCols; // only used for materialized views
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying to figure out why is this required? Can sortColNames be not used wherever sortCols is required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, this is not really required. We only use it to print the column names together with their types in the explain for CREATE MATERIALIZED VIEW statement. Logic is similar to partition columns, this will only be needed if we store these columns as entries in the SORT / BUCKET columns in metastore (as we do for normal tables), but currently we do not do that.

if (destinationTable.isMaterializedView() &&
mvRebuildMode == MaterializationRebuildMode.INSERT_OVERWRITE_REBUILD) {
// Data organization (DISTRIBUTED, SORTED, CLUSTERED) for materialized view
// TODO: We only do this for a full rebuild
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLUSTERED ON SORTED ON will be silently ignored for rest of the build types. Do you think it is good idea to log warning in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a WARN may be too aggressive, since there is nothing wrong in the system, it is just a feature that is missing (incremental maintenance of the view does not organize the new data according to the spec). I will add a DEBUG message though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about this and there is no need to log this info. This is a missing feature, and there is a TODO and a follow-up JIRA (https://issues.apache.org/jira/browse/HIVE-21953).

…lized views (Jesus Camacho Rodriguez, reviewed by Vineet Garg)

Close apache#696
@asfgit asfgit closed this in 4c028b8 Jul 10, 2019
b-slim pushed a commit to b-slim/hive that referenced this pull request Jul 23, 2019
…or materialized views (Jesus Camacho Rodriguez, reviewed by Vineet Garg)

Close apache#696

Change-Id: I36e63b2d4591027f10d43e286c19cd6179fbf4f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants