You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by xubo245 <gi...@git.apache.org> on 2017/11/17 02:52:18 UTC

[GitHub] carbondata pull request #1515: [CARBONDATA-1751] Modify sys.err to AnalysisE...

GitHub user xubo245 opened a pull request:

    https://github.com/apache/carbondata/pull/1515

    [CARBONDATA-1751] Modify sys.err to AnalysisException when uses run related operation except IUD,compaction and alter

    carbon printout improper error message, for example, it printout system error when users run create table with the same column name, but it should printout related exception information
    
    So we modify sys.error method to AnalysisException when uses run related operation except IUD,compaction and alter
    
    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. 
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/xubo245/carbondata fixSysError

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/carbondata/pull/1515.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1515
    
----
commit 696f02d4ece90308e729d3d7fed222aa58b0e9c9
Author: xubo245 <60...@qq.com>
Date:   2017-11-17T02:48:31Z

    [CARBONDATA-1751] Modify sys.err to AnalysisException when uses run related operation except IUD,compaction and alter

----


---

[GitHub] carbondata issue #1515: [CARBONDATA-1751] Modify sys.err to AnalysisExceptio...

Posted by xubo245 <gi...@git.apache.org>.
Github user xubo245 commented on the issue:

    https://github.com/apache/carbondata/pull/1515
  
    Please review it @jackylk  @QiangCai 


---

[GitHub] carbondata issue #1515: [CARBONDATA-1751] Modify sys.err to AnalysisExceptio...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1515
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1263/



---

[GitHub] carbondata pull request #1515: [CARBONDATA-1751] Modify sys.err to AnalysisE...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/carbondata/pull/1515


---

[GitHub] carbondata pull request #1515: [CARBONDATA-1751] Modify sys.err to AnalysisE...

Posted by xubo245 <gi...@git.apache.org>.
Github user xubo245 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1515#discussion_r151832180
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala ---
    @@ -662,16 +663,18 @@ object CommonUtil {
         val maxColumnsInt = getMaxColumnValue(maxColumns)
         if (maxColumnsInt != null) {
           if (columnCountInSchema >= maxColumnsInt) {
    -        sys.error(s"csv headers should be less than the max columns: $maxColumnsInt")
    +        CarbonException.analysisException(
    +          s"csv headers should be less than the max columns: $maxColumnsInt")
           } else if (maxColumnsInt > CSVInputFormat.THRESHOLD_MAX_NUMBER_OF_COLUMNS_FOR_PARSING) {
    -        sys.error(s"max columns cannot be greater than the threshold value: ${
    -          CSVInputFormat.THRESHOLD_MAX_NUMBER_OF_COLUMNS_FOR_PARSING
    -        }")
    +        CarbonException.analysisException(
    +          s"max columns cannot be greater than the threshold value: ${
    --- End diff --
    
    Ok, I have modified it.


---

[GitHub] carbondata issue #1515: [CARBONDATA-1751] Modify sys.err to AnalysisExceptio...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1515
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1224/



---

[GitHub] carbondata pull request #1515: [CARBONDATA-1751] Modify sys.err to AnalysisE...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1515#discussion_r151634168
  
    --- Diff: integration/spark-common-test/src/test/scala/org/apache/spark/sql/execution/command/CarbonTableSchemaCommonSuite.scala ---
    @@ -0,0 +1,69 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.sql.execution.command
    +
    +import org.apache.spark.sql.AnalysisException
    +import org.apache.spark.sql.test.util.QueryTest
    +import org.junit.Assert
    +import org.scalatest.BeforeAndAfterAll
    +
    +class CarbonTableSchemaCommonSuite extends QueryTest with BeforeAndAfterAll {
    +
    +  test("Creating table: Duplicate dimensions found with name, it should throw AnalysisException") {
    +    sql("DROP TABLE IF EXISTS carbon_table")
    +    try {
    +      sql(
    +        s"""
    +           | CREATE TABLE carbon_table(
    +           | BB INT, bb char(10)
    +           | )
    +           | STORED BY 'carbondata'
    +       """.stripMargin)
    +    } catch {
    +      case ex: AnalysisException => Assert.assertTrue(true)
    +      case ex: Exception => Assert.assertTrue(false)
    +    }
    --- End diff --
    
    If no exception, testcase should fail


---

[GitHub] carbondata issue #1515: [CARBONDATA-1751] Modify sys.err to AnalysisExceptio...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1515
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1203/



---

[GitHub] carbondata issue #1515: [CARBONDATA-1751] Modify sys.err to AnalysisExceptio...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1515
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1259/



---

[GitHub] carbondata issue #1515: [CARBONDATA-1751] Modify sys.err to AnalysisExceptio...

Posted by xubo245 <gi...@git.apache.org>.
Github user xubo245 commented on the issue:

    https://github.com/apache/carbondata/pull/1515
  
    Please review it @jackylk 


---

[GitHub] carbondata pull request #1515: [CARBONDATA-1751] Modify sys.err to AnalysisE...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1515#discussion_r151827674
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala ---
    @@ -662,16 +663,18 @@ object CommonUtil {
         val maxColumnsInt = getMaxColumnValue(maxColumns)
         if (maxColumnsInt != null) {
           if (columnCountInSchema >= maxColumnsInt) {
    -        sys.error(s"csv headers should be less than the max columns: $maxColumnsInt")
    +        CarbonException.analysisException(
    +          s"csv headers should be less than the max columns: $maxColumnsInt")
           } else if (maxColumnsInt > CSVInputFormat.THRESHOLD_MAX_NUMBER_OF_COLUMNS_FOR_PARSING) {
    -        sys.error(s"max columns cannot be greater than the threshold value: ${
    -          CSVInputFormat.THRESHOLD_MAX_NUMBER_OF_COLUMNS_FOR_PARSING
    -        }")
    +        CarbonException.analysisException(
    +          s"max columns cannot be greater than the threshold value: ${
    --- End diff --
    
    move 
    ```
    ${
     +            CSVInputFormat.THRESHOLD_MAX_NUMBER_OF_COLUMNS_FOR_PARSING
     +          }"
    ```
    into one line, like line 667. the same for line 677


---

[GitHub] carbondata issue #1515: [CARBONDATA-1751] Modify sys.err to AnalysisExceptio...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1515
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1209/



---

[GitHub] carbondata issue #1515: [CARBONDATA-1751] Modify sys.err to AnalysisExceptio...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1515
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1239/



---

[GitHub] carbondata pull request #1515: [CARBONDATA-1751] Modify sys.err to AnalysisE...

Posted by xubo245 <gi...@git.apache.org>.
Github user xubo245 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1515#discussion_r151832176
  
    --- Diff: integration/spark-common-test/src/test/scala/org/apache/spark/sql/execution/command/CarbonTableSchemaCommonSuite.scala ---
    @@ -0,0 +1,69 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.sql.execution.command
    +
    +import org.apache.spark.sql.AnalysisException
    +import org.apache.spark.sql.test.util.QueryTest
    +import org.junit.Assert
    +import org.scalatest.BeforeAndAfterAll
    +
    +class CarbonTableSchemaCommonSuite extends QueryTest with BeforeAndAfterAll {
    +
    +  test("Creating table: Duplicate dimensions found with name, it should throw AnalysisException") {
    +    sql("DROP TABLE IF EXISTS carbon_table")
    +    try {
    +      sql(
    +        s"""
    +           | CREATE TABLE carbon_table(
    +           | BB INT, bb char(10)
    +           | )
    +           | STORED BY 'carbondata'
    +       """.stripMargin)
    +    } catch {
    +      case ex: AnalysisException => Assert.assertTrue(true)
    +      case ex: Exception => Assert.assertTrue(false)
    +    }
    --- End diff --
    
    Ok, I have fixed it.


---

[GitHub] carbondata issue #1515: [CARBONDATA-1751] Modify sys.err to AnalysisExceptio...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1515
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1254/



---