You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/01/05 09:11:50 UTC

[GitHub] [spark] AngersZhuuuu opened a new pull request #31038: [SPARK-33844][SQL][3.0] InsertIntoHiveDir command should check col name too

AngersZhuuuu opened a new pull request #31038:
URL: https://github.com/apache/spark/pull/31038


   ### What changes were proposed in this pull request?
   
   In hive-1.2.1, hive serde just split `serdeConstants.LIST_COLUMNS` and `serdeConstants.LIST_COLUMN_TYPES` use comma.
   
   When we use spark 2.4 with UT 
   ```
     test("insert overwrite directory with comma col name") {
       withTempDir { dir =>
         val path = dir.toURI.getPath
   
         val v1 =
           s"""
              | INSERT OVERWRITE DIRECTORY '${path}'
              | STORED AS TEXTFILE
              | SELECT 1 as a, 'c' as b, if(1 = 1, "true", "false")
            """.stripMargin
   
         sql(v1).explain(true)
   
         sql(v1).show()
       }
     }
   ```
   failed with as below since column name contains `,` then column names and column types size not equal.
   ```
   19:56:05.618 ERROR org.apache.spark.sql.execution.datasources.FileFormatWriter:  [ angerszhu ] Aborting job dd774f18-93fa-431f-9468-3534c7d8acda.
   org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0, localhost, executor driver): org.apache.hadoop.hive.serde2.SerDeException: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe: columns has 5 elements while columns.types has 3 elements!
   	at org.apache.hadoop.hive.serde2.lazy.LazySerDeParameters.extractColumnInfo(LazySerDeParameters.java:145)
   	at org.apache.hadoop.hive.serde2.lazy.LazySerDeParameters.<init>(LazySerDeParameters.java:85)
   	at org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe.initialize(LazySimpleSerDe.java:125)
   	at org.apache.spark.sql.hive.execution.HiveOutputWriter.<init>(HiveFileFormat.scala:119)
   	at org.apache.spark.sql.hive.execution.HiveFileFormat$$anon$1.newInstance(HiveFileFormat.scala:103)
   	at org.apache.spark.sql.execution.datasources.SingleDirectoryDataWriter.newOutputWriter(FileFormatDataWriter.scala:120)
   	at org.apache.spark.sql.execution.datasources.SingleDirectoryDataWriter.<init>(FileFormatDataWriter.scala:108)
   	at org.apache.spark.sql.execution.datasources.FileFormatWriter$.org$apache$spark$sql$execution$datasources$FileFormatWriter$$executeTask(FileFormatWriter.scala:287)
   	at org.apache.spark.sql.execution.datasources.FileFormatWriter$$anonfun$write$1.apply(FileFormatWriter.scala:219)
   	at org.apache.spark.sql.execution.datasources.FileFormatWriter$$anonfun$write$1.apply(FileFormatWriter.scala:218)
   	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:90)
   	at org.apache.spark.scheduler.Task.run(Task.scala:121)
   	at org.apache.spark.executor.Executor$TaskRunner$$anonfun$12.apply(Executor.scala:461)
   	at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1360)
   	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:467)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:748)
   
   ```
    
   After hive-2.3 we will set COLUMN_NAME_DELIMITER to special char when col name cntains ',':
   https://github.com/apache/hive/blob/6f4c35c9e904d226451c465effdc5bfd31d395a0/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java#L1180-L1188
   https://github.com/apache/hive/blob/6f4c35c9e904d226451c465effdc5bfd31d395a0/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java#L1044-L1075
   
   And in script transform, we parse column name  to avoid this problem 
   https://github.com/apache/spark/blob/554600c2af0dbc8979955807658fafef5dc66c08/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveScriptTransformationExec.scala#L257-L261
   
   So I think in `InsertIntoHiveDirComman`, we should do same thing too. And I have verified this method can make spark-2.4 work well.
   
   
   ### Why are the changes needed?
   More save use serde
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #31038: [SPARK-33844][SQL][3.0] InsertIntoHiveDir command should check col name too

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31038:
URL: https://github.com/apache/spark/pull/31038#issuecomment-754599108


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38263/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #31038: [SPARK-33844][SQL][3.0] InsertIntoHiveDir command should check col name too

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31038:
URL: https://github.com/apache/spark/pull/31038#issuecomment-754817843


   **[Test build #133674 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133674/testReport)** for PR 31038 at commit [`e909b6e`](https://github.com/apache/spark/commit/e909b6e7aa418ec7f3bd2e53a0e421409a516738).
    * This patch **fails from timeout after a configured wait of `500m`**.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #31038: [SPARK-33844][SQL][3.0] InsertIntoHiveDir command should check col name too

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31038:
URL: https://github.com/apache/spark/pull/31038#issuecomment-754622823


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/38263/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #31038: [SPARK-33844][SQL][3.0] InsertIntoHiveDir command should check col name too

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31038:
URL: https://github.com/apache/spark/pull/31038#issuecomment-754540958


   **[Test build #133674 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133674/testReport)** for PR 31038 at commit [`e909b6e`](https://github.com/apache/spark/commit/e909b6e7aa418ec7f3bd2e53a0e421409a516738).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan closed pull request #31038: [SPARK-33844][SQL][3.0] InsertIntoHiveDir command should check col name too

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #31038:
URL: https://github.com/apache/spark/pull/31038


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on pull request #31038: [SPARK-33844][SQL][3.0] InsertIntoHiveDir command should check col name too

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #31038:
URL: https://github.com/apache/spark/pull/31038#issuecomment-754857175


   GA passed, merging to 3.0, thanks!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #31038: [SPARK-33844][SQL][3.0] InsertIntoHiveDir command should check col name too

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31038:
URL: https://github.com/apache/spark/pull/31038#issuecomment-754589797


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/38263/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AngersZhuuuu commented on pull request #31038: [SPARK-33844][SQL][3.0] InsertIntoHiveDir command should check col name too

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on pull request #31038:
URL: https://github.com/apache/spark/pull/31038#issuecomment-754631336


   FYI @cloud-fan 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #31038: [SPARK-33844][SQL][3.0] InsertIntoHiveDir command should check col name too

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31038:
URL: https://github.com/apache/spark/pull/31038#issuecomment-754622823


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/38263/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #31038: [SPARK-33844][SQL][3.0] InsertIntoHiveDir command should check col name too

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31038:
URL: https://github.com/apache/spark/pull/31038#issuecomment-754540958


   **[Test build #133674 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/133674/testReport)** for PR 31038 at commit [`e909b6e`](https://github.com/apache/spark/commit/e909b6e7aa418ec7f3bd2e53a0e421409a516738).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org