[GitHub] [carbondata] MarvinLitt opened a new pull request #3518: [DOC] add performance-tuning with codegen parameters support

classic Classic list List threaded Threaded
37 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#discussion_r364208450
 
 

 ##########
 File path: docs/query-with-spark-sql-performacne-tuning.md
 ##########
 @@ -0,0 +1,58 @@
+<!--
+    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.
+-->
+
+# Query with spark-sql performacne tuning
+  This tutorial guides you to create CarbonData Tables and optimize performance.
+  The following sections will elaborate on the below topics :
+
+  * [The influence of spark.sql.codegen.wholeStage configuration on query](#The influence of spark.sql.codegen.wholeStage configuration on query)
+
+## The influence of spark.sql.codegen.wholeStage configuration on query
+
+In practice, we found that when the sum of CarbonData's queries reaches a certain threshold, the query time increases dramatically. As shown in the figure below(spark 2.1):
+
+![File Directory Structure](../docs/images/codegen.png?raw=true)
+
+The horizontal axis is the number of sum, and the vertical axis is the time consumed in seconds.
+
+It can be seen from the figure that when the number of sum exceeds 85, the query time is significantly increased.
+
+After analysis, this problem is related to spark.sql.codegen.wholeStage, which is enabled by default for spark 2.0. and it will do all the *internal optimization possible from the spark catalist side*. [https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html)
 
 Review comment:
   okay, done

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#discussion_r364211975
 
 

 ##########
 File path: docs/query-with-spark-sql-performacne-tuning.md
 ##########
 @@ -0,0 +1,58 @@
+<!--
+    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.
+-->
+
+# Query with spark-sql performacne tuning
+  This tutorial guides you to create CarbonData Tables and optimize performance.
+  The following sections will elaborate on the below topics :
+
+  * [The influence of spark.sql.codegen.wholeStage configuration on query](#The influence of spark.sql.codegen.wholeStage configuration on query)
+
+## The influence of spark.sql.codegen.wholeStage configuration on query
+
+In practice, we found that when the sum of CarbonData's queries reaches a certain threshold, the query time increases dramatically. As shown in the figure below(spark 2.1):
+
+![File Directory Structure](../docs/images/codegen.png?raw=true)
+
+The horizontal axis is the number of sum, and the vertical axis is the time consumed in seconds.
+
+It can be seen from the figure that when the number of sum exceeds 85, the query time is significantly increased.
+
+After analysis, this problem is related to spark.sql.codegen.wholeStage, which is enabled by default for spark 2.0. and it will do all the *internal optimization possible from the spark catalist side*. [https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html)
+
+**Whole-Stage Java Code Generation** (aka *Whole-Stage CodeGen*) is a physical query optimization in Spark SQL that fuses multiple physical operators (as a subtree of plans that [support code generation](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-CodegenSupport.html)) together into a single Java function.
+
+Whole-Stage Java Code Generation improves the execution performance of a query by collapsing a query tree into a single optimized function that eliminates virtual function calls and leverages CPU registers for intermediate data.
+
+When sum is too large, the logic calculation function of hashaggregate operator is too large (there are nearly 3000 lines of code when there are 34 indicators). Java itself does not recommend too large methods, which will reduce the processing efficiency, and exceed the JIT threshold, making the final execution in the way of interpretation. When the carbon grows in the counter, the performance drops sharply.
 
 Review comment:
   yes, your suggestion is good, has modify.

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#discussion_r364216102
 
 

 ##########
 File path: docs/query-with-spark-sql-performacne-tuning.md
 ##########
 @@ -0,0 +1,58 @@
+<!--
+    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.
+-->
+
+# Query with spark-sql performacne tuning
+  This tutorial guides you to create CarbonData Tables and optimize performance.
+  The following sections will elaborate on the below topics :
+
+  * [The influence of spark.sql.codegen.wholeStage configuration on query](#The influence of spark.sql.codegen.wholeStage configuration on query)
+
+## The influence of spark.sql.codegen.wholeStage configuration on query
+
+In practice, we found that when the sum of CarbonData's queries reaches a certain threshold, the query time increases dramatically. As shown in the figure below(spark 2.1):
+
+![File Directory Structure](../docs/images/codegen.png?raw=true)
+
+The horizontal axis is the number of sum, and the vertical axis is the time consumed in seconds.
+
+It can be seen from the figure that when the number of sum exceeds 85, the query time is significantly increased.
+
+After analysis, this problem is related to spark.sql.codegen.wholeStage, which is enabled by default for spark 2.0. and it will do all the *internal optimization possible from the spark catalist side*. [https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html)
+
+**Whole-Stage Java Code Generation** (aka *Whole-Stage CodeGen*) is a physical query optimization in Spark SQL that fuses multiple physical operators (as a subtree of plans that [support code generation](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-CodegenSupport.html)) together into a single Java function.
+
+Whole-Stage Java Code Generation improves the execution performance of a query by collapsing a query tree into a single optimized function that eliminates virtual function calls and leverages CPU registers for intermediate data.
+
+When sum is too large, the logic calculation function of hashaggregate operator is too large (there are nearly 3000 lines of code when there are 34 indicators). Java itself does not recommend too large methods, which will reduce the processing efficiency, and exceed the JIT threshold, making the final execution in the way of interpretation. When the carbon grows in the counter, the performance drops sharply.
+
+But unfortunately, spark 2.1 only provides switching capability. User can only choose to turn the function on or off. This leads to a sharp drop in performance when the aggregation operator is too large.
+
+Fortunately, spark 2.3 provide more configuration. Users can better configure this parameter.
 
 Review comment:
   add link for user to check the configurations.

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#discussion_r364219468
 
 

 ##########
 File path: docs/query-with-spark-sql-performacne-tuning.md
 ##########
 @@ -0,0 +1,58 @@
+<!--
+    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.
+-->
+
+# Query with spark-sql performacne tuning
+  This tutorial guides you to create CarbonData Tables and optimize performance.
+  The following sections will elaborate on the below topics :
+
+  * [The influence of spark.sql.codegen.wholeStage configuration on query](#The influence of spark.sql.codegen.wholeStage configuration on query)
+
+## The influence of spark.sql.codegen.wholeStage configuration on query
+
+In practice, we found that when the sum of CarbonData's queries reaches a certain threshold, the query time increases dramatically. As shown in the figure below(spark 2.1):
+
+![File Directory Structure](../docs/images/codegen.png?raw=true)
+
+The horizontal axis is the number of sum, and the vertical axis is the time consumed in seconds.
+
+It can be seen from the figure that when the number of sum exceeds 85, the query time is significantly increased.
+
+After analysis, this problem is related to spark.sql.codegen.wholeStage, which is enabled by default for spark 2.0. and it will do all the *internal optimization possible from the spark catalist side*. [https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html)
+
+**Whole-Stage Java Code Generation** (aka *Whole-Stage CodeGen*) is a physical query optimization in Spark SQL that fuses multiple physical operators (as a subtree of plans that [support code generation](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-CodegenSupport.html)) together into a single Java function.
+
+Whole-Stage Java Code Generation improves the execution performance of a query by collapsing a query tree into a single optimized function that eliminates virtual function calls and leverages CPU registers for intermediate data.
+
+When sum is too large, the logic calculation function of hashaggregate operator is too large (there are nearly 3000 lines of code when there are 34 indicators). Java itself does not recommend too large methods, which will reduce the processing efficiency, and exceed the JIT threshold, making the final execution in the way of interpretation. When the carbon grows in the counter, the performance drops sharply.
+
+But unfortunately, spark 2.1 only provides switching capability. User can only choose to turn the function on or off. This leads to a sharp drop in performance when the aggregation operator is too large.
+
+Fortunately, spark 2.3 provide more configuration. Users can better configure this parameter.
+
+So in spark 2.1, when the number of operators cannot be confirmed, spark.sql.codegen.wholeStage can be turned off to ensure the query efficiency. when in spark 2.3 and above users can open spark.sql.codegen.wholeStage  and configure it.  
 
 Review comment:
   It's reasonable. I'll adjust it.

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#discussion_r364223369
 
 

 ##########
 File path: docs/query-with-spark-sql-performacne-tuning.md
 ##########
 @@ -0,0 +1,58 @@
+<!--
+    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.
+-->
+
+# Query with spark-sql performacne tuning
 
 Review comment:
   sorry,both modify file name and title.

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#discussion_r364223612
 
 

 ##########
 File path: docs/query-with-spark-sql-performacne-tuning.md
 ##########
 @@ -0,0 +1,58 @@
+<!--
+    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.
+-->
+
+# Query with spark-sql performacne tuning
+  This tutorial guides you to create CarbonData Tables and optimize performance.
+  The following sections will elaborate on the below topics :
+
+  * [The influence of spark.sql.codegen.wholeStage configuration on query](#The influence of spark.sql.codegen.wholeStage configuration on query)
+
+## The influence of spark.sql.codegen.wholeStage configuration on query
+
+In practice, we found that when the sum of CarbonData's queries reaches a certain threshold, the query time increases dramatically. As shown in the figure below(spark 2.1):
+
+![File Directory Structure](../docs/images/codegen.png?raw=true)
+
+The horizontal axis is the number of sum, and the vertical axis is the time consumed in seconds.
+
+It can be seen from the figure that when the number of sum exceeds 85, the query time is significantly increased.
+
+After analysis, this problem is related to spark.sql.codegen.wholeStage, which is enabled by default for spark 2.0. and it will do all the *internal optimization possible from the spark catalist side*. [https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html)
 
 Review comment:
   done

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#discussion_r364223921
 
 

 ##########
 File path: docs/query-with-spark-sql-performacne-tuning.md
 ##########
 @@ -0,0 +1,58 @@
+<!--
+    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.
+-->
+
+# Query with spark-sql performacne tuning
+  This tutorial guides you to create CarbonData Tables and optimize performance.
+  The following sections will elaborate on the below topics :
+
+  * [The influence of spark.sql.codegen.wholeStage configuration on query](#The influence of spark.sql.codegen.wholeStage configuration on query)
+
+## The influence of spark.sql.codegen.wholeStage configuration on query
+
+In practice, we found that when the sum of CarbonData's queries reaches a certain threshold, the query time increases dramatically. As shown in the figure below(spark 2.1):
+
+![File Directory Structure](../docs/images/codegen.png?raw=true)
+
+The horizontal axis is the number of sum, and the vertical axis is the time consumed in seconds.
+
+It can be seen from the figure that when the number of sum exceeds 85, the query time is significantly increased.
+
+After analysis, this problem is related to spark.sql.codegen.wholeStage, which is enabled by default for spark 2.0. and it will do all the *internal optimization possible from the spark catalist side*. [https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html)
+
+**Whole-Stage Java Code Generation** (aka *Whole-Stage CodeGen*) is a physical query optimization in Spark SQL that fuses multiple physical operators (as a subtree of plans that [support code generation](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-CodegenSupport.html)) together into a single Java function.
+
+Whole-Stage Java Code Generation improves the execution performance of a query by collapsing a query tree into a single optimized function that eliminates virtual function calls and leverages CPU registers for intermediate data.
+
+When sum is too large, the logic calculation function of hashaggregate operator is too large (there are nearly 3000 lines of code when there are 34 indicators). Java itself does not recommend too large methods, which will reduce the processing efficiency, and exceed the JIT threshold, making the final execution in the way of interpretation. When the carbon grows in the counter, the performance drops sharply.
 
 Review comment:
   yes, modify.

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#discussion_r364233771
 
 

 ##########
 File path: docs/query-with-spark-sql-performacne-tuning.md
 ##########
 @@ -0,0 +1,58 @@
+<!--
+    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.
+-->
+
+# Query with spark-sql performacne tuning
+  This tutorial guides you to create CarbonData Tables and optimize performance.
+  The following sections will elaborate on the below topics :
+
+  * [The influence of spark.sql.codegen.wholeStage configuration on query](#The influence of spark.sql.codegen.wholeStage configuration on query)
+
+## The influence of spark.sql.codegen.wholeStage configuration on query
+
+In practice, we found that when the sum of CarbonData's queries reaches a certain threshold, the query time increases dramatically. As shown in the figure below(spark 2.1):
+
+![File Directory Structure](../docs/images/codegen.png?raw=true)
+
+The horizontal axis is the number of sum, and the vertical axis is the time consumed in seconds.
 
 Review comment:
   done

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA1 commented on issue #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
CarbonDataQA1 commented on issue #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#issuecomment-572107573
 
 
   Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1535/
   

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] kevinjmh commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
kevinjmh commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#discussion_r364526817
 
 

 ##########
 File path: docs/query-with-spark-sql-performance -tuning.md
 ##########
 @@ -0,0 +1,58 @@
+<!--
+    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.
+-->
+
+# Query with spark-sql performacne tuning
+  This tutorial guides you to create CarbonData Tables and optimize performance.
+  The following sections will elaborate on the below topics :
+
+  * [The influence of spark.sql.codegen.wholeStage configuration on query](#The influence of spark.sql.codegen.wholeStage configuration on query)
+
+## The influence of spark.sql.codegen.wholeStage configuration on query
+
+In practice, we found that when the number of columns applied SUM operator reaches a certain threshold, the query time increases dramatically.  we define "counter" for the meaning of columns applied SUM operator. Below will use  "counter" instead of the columns applied SUM operator.
+
+As shown in the figure below(spark 2.1):
+
+![File Directory Structure](../docs/images/codegen.png?raw=true)
+
+The horizontal axis is the number of counter, and the vertical axis is the time consumed in seconds.
+
+It can be seen from the figure that when the number of counter exceeds 85, the query time is significantly increased.
+
+After analysis, this problem is related to ["spark.sql.codegen.wholeStage"](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html), which is enabled by default since spark 2.0. and it will do all the *internal optimization possible from the spark catalyst side*.
+
+**Whole-Stage Java Code Generation** (aka *Whole-Stage CodeGen*) is a physical query optimization in Spark SQL that fuses multiple physical operators (as a subtree of plans that [support code generation](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-CodegenSupport.html)) together into a single Java function.
+
+Whole-Stage Java Code Generation improves the execution performance of a query by collapsing a query tree into a single optimized function that eliminates virtual function calls and leverages CPU registers for intermediate data.
+
+When counter is too large, the logic calculation function of hashaggregate operator is too large (there are nearly 3000 lines of code when there are 34 counters). Java itself does not recommend too large methods, which will reduce the processing efficiency, and exceed the JIT threshold, making the final execution in the way of interpretation. When the query grows in the counter, the performance drops sharply.
 
 Review comment:
   As the number of counter grows, generated codes for data process become larger. There are nearly 3000 lines of code when 34 counters. Java does not recommend huge methods, which can not make use of JIT and the code will run in interpretation mode. So the performance drops sharply when the counter in query grows.

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
MarvinLitt commented on a change in pull request #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#discussion_r364531550
 
 

 ##########
 File path: docs/query-with-spark-sql-performance -tuning.md
 ##########
 @@ -0,0 +1,58 @@
+<!--
+    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.
+-->
+
+# Query with spark-sql performacne tuning
+  This tutorial guides you to create CarbonData Tables and optimize performance.
+  The following sections will elaborate on the below topics :
+
+  * [The influence of spark.sql.codegen.wholeStage configuration on query](#The influence of spark.sql.codegen.wholeStage configuration on query)
+
+## The influence of spark.sql.codegen.wholeStage configuration on query
+
+In practice, we found that when the number of columns applied SUM operator reaches a certain threshold, the query time increases dramatically.  we define "counter" for the meaning of columns applied SUM operator. Below will use  "counter" instead of the columns applied SUM operator.
+
+As shown in the figure below(spark 2.1):
+
+![File Directory Structure](../docs/images/codegen.png?raw=true)
+
+The horizontal axis is the number of counter, and the vertical axis is the time consumed in seconds.
+
+It can be seen from the figure that when the number of counter exceeds 85, the query time is significantly increased.
+
+After analysis, this problem is related to ["spark.sql.codegen.wholeStage"](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-whole-stage-codegen.html), which is enabled by default since spark 2.0. and it will do all the *internal optimization possible from the spark catalyst side*.
+
+**Whole-Stage Java Code Generation** (aka *Whole-Stage CodeGen*) is a physical query optimization in Spark SQL that fuses multiple physical operators (as a subtree of plans that [support code generation](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/spark-sql-CodegenSupport.html)) together into a single Java function.
+
+Whole-Stage Java Code Generation improves the execution performance of a query by collapsing a query tree into a single optimized function that eliminates virtual function calls and leverages CPU registers for intermediate data.
+
+When counter is too large, the logic calculation function of hashaggregate operator is too large (there are nearly 3000 lines of code when there are 34 counters). Java itself does not recommend too large methods, which will reduce the processing efficiency, and exceed the JIT threshold, making the final execution in the way of interpretation. When the query grows in the counter, the performance drops sharply.
 
 Review comment:
   okay

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA1 commented on issue #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
CarbonDataQA1 commented on issue #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#issuecomment-572369756
 
 
   Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1549/
   

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA1 commented on issue #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
CarbonDataQA1 commented on issue #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#issuecomment-572387335
 
 
   Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1555/
   

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] kevinjmh commented on issue #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
kevinjmh commented on issue #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#issuecomment-572464562
 
 
   LGTM

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA1 commented on issue #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
CarbonDataQA1 commented on issue #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#issuecomment-572498675
 
 
   Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1563/
   

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] jackylk commented on issue #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
jackylk commented on issue #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518#issuecomment-573316089
 
 
   LGTM

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] asfgit closed pull request #3518: [DOC] add performance-tuning with codegen parameters support

GitBox
In reply to this post by GitBox
asfgit closed pull request #3518: [DOC] add performance-tuning with codegen parameters support
URL: https://github.com/apache/carbondata/pull/3518
 
 
   

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services
12