Skip to content

Conversation

@miklosgergely
Copy link
Contributor

DDLSemanticAnalyzer is a huge class, more than 4000 lines long. The goal is to refactor it in order to have everything cut into more handleable classes under the package org.apache.hadoop.hive.ql.exec.ddl:

  • have a separate class for each analyzers
  • have a package for each operation, containing an analyzer, a description, and an operation, so the amount of classes under a package is more manageable

Step #6: extract all the vire related analyzers from DDLSemanticAnalyzer, and move them under the new package.

Copy link
Contributor

@jcamachor jcamachor left a comment

Choose a reason for hiding this comment

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

I left some minor comments. It looks good overall. It needs rebasing after HIVE-21344 went in.

static {
Set<Class<? extends BaseSemanticAnalyzer>> analyzerClasses =
Set<Class<? extends BaseSemanticAnalyzer>> analyzerClasses1 =
new Reflections("org.apache.hadoop.hive.ql.ddl").getSubTypesOf(BaseSemanticAnalyzer.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have this String as private static final at the class level?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

public AlterMaterializedViewRewriteDesc(String fqMaterializedViewName, boolean rewriteEnable) {
this.fqMaterializedViewName = fqMaterializedViewName;
public AlterMaterializedViewRewriteDesc(String materializedViewName, boolean rewriteEnable) {
this.materializedViewName = materializedViewName;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a comment stating that it is the fully qualified name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Put back the fq prefix.


import com.google.common.annotations.VisibleForTesting;

import avro.shaded.com.google.common.collect.Sets;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not use the shaded version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@miklosgergely miklosgergely deleted the HIVE-22276 branch October 15, 2019 09:26
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