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

[CARBONDATA-3276] Compacting table that do not exist should modify the message of MalformedCarbonCommandException #3106

Closed
wants to merge 3 commits into from

Conversation

qiuchenjian
Copy link
Contributor

@qiuchenjian qiuchenjian commented Jan 28, 2019

[Solution]
Compacting table that do not exist should throw NoSuchTableException instead of MalformedCarbonCommandException("Operation not allowed : ALTER TABLE table_name COMPACT 'MAJOR'")
it's confused

Be sure to do all of the following checklist to help us incorporate
your contribution quickly and easily:

  • Any interfaces changed?

  • Any backward compatibility impacted?

  • Document update required?

  • Testing done
    Please provide details on
    - Whether new unit test cases have been added or why no new tests are required?
    - How it is tested? Please attach test report.
    - Is it a performance related change? Please attach the performance test report.
    - Any additional information to help reviewers in testing this change.

  • For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/2463/

@CarbonDataQA
Copy link

Build Success with Spark 2.3.2, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/10720/

@CarbonDataQA
Copy link

Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/2690/

…uchTableException instead of MalformedCarbonCommandException
@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/2495/

@CarbonDataQA
Copy link

Build Success with Spark 2.3.2, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/10753/

@CarbonDataQA
Copy link

Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/2724/

@InterfaceAudience.User
@InterfaceStability.Stable
public class NoSuchCarbonTableException extends MalformedCarbonCommandException {
public NoSuchCarbonTableException(String db, String table) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel this PR may not be required

  1. Spark already provides NoSuchTableException. We can use the same to throw the error if required
  2. You are making the use of this exception in DDLStrategy. In DDLstrategy we specifically check for CarbonTable. If CarbonTable is not found then it can also be a parquet or hive table. So I think either we should continue with current malformed exception being thrown or we should pass the flow to hive/parquet and let the exception be thrown from there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@manishgupta88

  1. i think MalformedCarbonCommandException is not right, user will not know the real exception
  2. the ddl is used for carbon, so i don't think we should pass the flow to hive
  3. Do you think which is better? NoSuchTableException or NoSuchCarbonTableException , or some better suggests?

Copy link
Contributor

Choose a reason for hiding this comment

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

@qiuchenjian ..

  1. Carbon in one of the component integrated with spark just like hive and we can multiple components integrated together in one system with spark. In DDLStratgey we are just tapping the commands to check for the carbon table. If its a carbon table we give to carbon flow else we give it to spark. We are throwing Malformed exception because spark itself does not support the Alter operation.
  2. Still If you want to change the Malformed exception you can change it to NoSuchTableExcpetion. Its a generic exception and should be sufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@manishgupta88 I still suggest to mention user more clearly, i change it to NoSuchTableException, please review again, thank you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@manishgupta88 discuss with david (@QiangCai ), he suggest to use MalformedCarbonCommandException and modify the message to "Table or view 'no_table' not found in database 'default' or not carbon format"

Copy link
Contributor

Choose a reason for hiding this comment

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

@qiuchenjian ...This was the very first comment that we throw MalformedCarbonCommandException for a reason and the PR may not be required but you were not convinced. Now that you have taken another opinion you can make the required changes and get it reviewed and merged

…uchTableException instead of MalformedCarbonCommandException
@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/2583/

@CarbonDataQA
Copy link

Build Success with Spark 2.3.2, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/10843/

@CarbonDataQA
Copy link

Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/2814/

@manishgupta88
Copy link
Contributor

LGTM

@qiuchenjian qiuchenjian changed the title [CARBONDATA-3276] Compacting table that do not exist should throw NoSuchTableException instead of MalformedCarbonCommandException [CARBONDATA-3276] Compacting table that do not exist should modify the message of MalformedCarbonCommandException Feb 22, 2019
@CarbonDataQA
Copy link

Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/2599/

@QiangCai
Copy link
Contributor

LGTM

@CarbonDataQA
Copy link

Build Success with Spark 2.3.2, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/10858/

@CarbonDataQA
Copy link

Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/2829/

@asfgit asfgit closed this in 99dfcbe Feb 23, 2019
asfgit pushed a commit that referenced this pull request Apr 2, 2019
…e message of MalformedCarbonCommandException

This closes #3106
qiuchenjian added a commit to qiuchenjian/carbondata that referenced this pull request Jun 14, 2019
…e message of MalformedCarbonCommandException

This closes apache#3106
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.

None yet

5 participants