[ 
https://issues.apache.org/jira/browse/HIVE-19360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16458772#comment-16458772
 ] 

Hive QA commented on HIVE-19360:
--------------------------------



Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12921272/HIVE-19360.1.patch

{color:red}ERROR:{color} -1 due to build exiting with an error

Test results: 
https://builds.apache.org/job/PreCommit-HIVE-Build/10583/testReport
Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/10583/console
Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-10583/

Messages:
{noformat}
Executing org.apache.hive.ptest.execution.TestCheckPhase
Executing org.apache.hive.ptest.execution.PrepPhase
Tests exited with: NonZeroExitCodeException
Command 'bash /data/hiveptest/working/scratch/source-prep.sh' failed with exit 
status 1 and output '+ date '+%Y-%m-%d %T.%3N'
2018-04-30 17:03:49.511
+ [[ -n /usr/lib/jvm/java-8-openjdk-amd64 ]]
+ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
+ JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
+ export 
PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin/:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
+ 
PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin/:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
+ export 'ANT_OPTS=-Xmx1g -XX:MaxPermSize=256m '
+ ANT_OPTS='-Xmx1g -XX:MaxPermSize=256m '
+ export 'MAVEN_OPTS=-Xmx1g '
+ MAVEN_OPTS='-Xmx1g '
+ cd /data/hiveptest/working/
+ tee /data/hiveptest/logs/PreCommit-HIVE-Build-10583/source-prep.txt
+ [[ false == \t\r\u\e ]]
+ mkdir -p maven ivy
+ [[ git = \s\v\n ]]
+ [[ git = \g\i\t ]]
+ [[ -z master ]]
+ [[ -d apache-github-source-source ]]
+ [[ ! -d apache-github-source-source/.git ]]
+ [[ ! -d apache-github-source-source ]]
+ date '+%Y-%m-%d %T.%3N'
2018-04-30 17:03:49.531
+ cd apache-github-source-source
+ git fetch origin
>From https://github.com/apache/hive
   a095c3d..ac6b2a3  master     -> origin/master
   657dfef..10dcff6  storage-branch-2.6 -> origin/storage-branch-2.6
 * [new tag]         rel/storage-release-2.6.0 -> rel/storage-release-2.6.0
+ git reset --hard HEAD
HEAD is now at a095c3d HIVE-19352: Vectorization: Disable vectorization for 
org.apache.hive.jdbc.TestJdbcDriver2.testResultSetMetaData (Matt McCline, 
reviewed by Vineet Garg)
+ git clean -f -d
+ git checkout master
Already on 'master'
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
  (use "git pull" to update your local branch)
+ git reset --hard origin/master
HEAD is now at ac6b2a3 HIVE-18910 : Migrate to Murmur hash for shuffle and 
bucketing (Deepak Jaiswal, reviewed by Jasone Dere)
+ git merge --ff-only origin/master
Already up-to-date.
+ date '+%Y-%m-%d %T.%3N'
2018-04-30 17:04:04.568
+ rm -rf ../yetus_PreCommit-HIVE-Build-10583
+ mkdir ../yetus_PreCommit-HIVE-Build-10583
+ git gc
+ cp -R . ../yetus_PreCommit-HIVE-Build-10583
+ mkdir /data/hiveptest/logs/PreCommit-HIVE-Build-10583/yetus
+ patchCommandPath=/data/hiveptest/working/scratch/smart-apply-patch.sh
+ patchFilePath=/data/hiveptest/working/scratch/build.patch
+ [[ -f /data/hiveptest/working/scratch/build.patch ]]
+ chmod +x /data/hiveptest/working/scratch/smart-apply-patch.sh
+ /data/hiveptest/working/scratch/smart-apply-patch.sh 
/data/hiveptest/working/scratch/build.patch
Going to apply patch with: git apply -p0
/data/hiveptest/working/scratch/build.patch:66: trailing whitespace.
  
/data/hiveptest/working/scratch/build.patch:70: trailing whitespace.
  
/data/hiveptest/working/scratch/build.patch:192: trailing whitespace.
  
/data/hiveptest/working/scratch/build.patch:193: trailing whitespace.
  /** 
/data/hiveptest/working/scratch/build.patch:194: trailing whitespace.
   * Get SQL rewrite for a Calcite logical plan 
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.
+ [[ maven == \m\a\v\e\n ]]
+ rm -rf /data/hiveptest/working/maven/org/apache/hive
+ mvn -B clean install -DskipTests -T 4 -q 
-Dmaven.repo.local=/data/hiveptest/working/maven
protoc-jar: executing: [/tmp/protoc1241405006772359790.exe, --version]
libprotoc 2.5.0
protoc-jar: executing: [/tmp/protoc1241405006772359790.exe, 
-I/data/hiveptest/working/apache-github-source-source/standalone-metastore/src/main/protobuf/org/apache/hadoop/hive/metastore,
 
--java_out=/data/hiveptest/working/apache-github-source-source/standalone-metastore/target/generated-sources,
 
/data/hiveptest/working/apache-github-source-source/standalone-metastore/src/main/protobuf/org/apache/hadoop/hive/metastore/metastore.proto]
ANTLR Parser Generator  Version 3.5.2
Output file 
/data/hiveptest/working/apache-github-source-source/standalone-metastore/target/generated-sources/org/apache/hadoop/hive/metastore/parser/FilterParser.java
 does not exist: must build 
/data/hiveptest/working/apache-github-source-source/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/parser/Filter.g
org/apache/hadoop/hive/metastore/parser/Filter.g
log4j:WARN No appenders could be found for logger (DataNucleus.Persistence).
log4j:WARN Please initialize the log4j system properly.
DataNucleus Enhancer (version 4.1.17) for API "JDO"
DataNucleus Enhancer completed with success for 40 classes.
ANTLR Parser Generator  Version 3.5.2
Output file 
/data/hiveptest/working/apache-github-source-source/ql/target/generated-sources/antlr3/org/apache/hadoop/hive/ql/parse/HiveLexer.java
 does not exist: must build 
/data/hiveptest/working/apache-github-source-source/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g
org/apache/hadoop/hive/ql/parse/HiveLexer.g
Output file 
/data/hiveptest/working/apache-github-source-source/ql/target/generated-sources/antlr3/org/apache/hadoop/hive/ql/parse/HiveParser.java
 does not exist: must build 
/data/hiveptest/working/apache-github-source-source/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
org/apache/hadoop/hive/ql/parse/HiveParser.g
warning(200): org/apache/hadoop/hive/ql/parse/HiveParser.g:2376:5: 
Decision can match input such as "KW_CHECK {KW_EXISTS, KW_TINYINT}" using 
multiple alternatives: 1, 2

As a result, alternative(s) 2 were disabled for that input
warning(200): org/apache/hadoop/hive/ql/parse/HiveParser.g:2376:5: 
Decision can match input such as "KW_CHECK KW_STRUCT LESSTHAN" using multiple 
alternatives: 1, 2

As a result, alternative(s) 2 were disabled for that input
warning(200): org/apache/hadoop/hive/ql/parse/HiveParser.g:2376:5: 
Decision can match input such as "KW_CHECK KW_DATETIME" using multiple 
alternatives: 1, 2

As a result, alternative(s) 2 were disabled for that input
warning(200): org/apache/hadoop/hive/ql/parse/HiveParser.g:2376:5: 
Decision can match input such as "KW_CHECK KW_DATE {LPAREN, StringLiteral}" 
using multiple alternatives: 1, 2

As a result, alternative(s) 2 were disabled for that input
warning(200): org/apache/hadoop/hive/ql/parse/HiveParser.g:2376:5: 
Decision can match input such as "KW_CHECK KW_UNIONTYPE LESSTHAN" using 
multiple alternatives: 1, 2

As a result, alternative(s) 2 were disabled for that input
Output file 
/data/hiveptest/working/apache-github-source-source/ql/target/generated-sources/antlr3/org/apache/hadoop/hive/ql/parse/HintParser.java
 does not exist: must build 
/data/hiveptest/working/apache-github-source-source/ql/src/java/org/apache/hadoop/hive/ql/parse/HintParser.g
org/apache/hadoop/hive/ql/parse/HintParser.g
Generating vector expression code
Generating vector expression test code
Processing annotations
Annotations processed
Processing annotations
No elements to process
[ERROR] COMPILATION ERROR : 
[ERROR] 
/data/hiveptest/working/apache-github-source-source/ql/src/java/org/apache/hadoop/hive/ql/hooks/HiveProtoLoggingHook.java:[435,26]
 no suitable constructor found for 
ExplainWork(<nulltype>,<nulltype>,java.util.ArrayList<org.apache.hadoop.hive.ql.exec.Task<?
 extends 
java.io.Serializable>>,org.apache.hadoop.hive.ql.exec.FetchTask,<nulltype>,org.apache.hadoop.hive.ql.parse.ExplainConfiguration,<nulltype>)
    constructor org.apache.hadoop.hive.ql.plan.ExplainWork.ExplainWork() is not 
applicable
      (actual and formal argument lists differ in length)
    constructor 
org.apache.hadoop.hive.ql.plan.ExplainWork.ExplainWork(org.apache.hadoop.fs.Path,org.apache.hadoop.hive.ql.parse.ParseContext,java.util.List<org.apache.hadoop.hive.ql.exec.Task<?
 extends java.io.Serializable>>,org.apache.hadoop.hive.ql.exec.Task<? extends 
java.io.Serializable>,org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer,org.apache.hadoop.hive.ql.parse.ExplainConfiguration,java.lang.String,java.lang.String)
 is not applicable
      (actual and formal argument lists differ in length)
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) 
on project hive-exec: Compilation failure
[ERROR] 
/data/hiveptest/working/apache-github-source-source/ql/src/java/org/apache/hadoop/hive/ql/hooks/HiveProtoLoggingHook.java:[435,26]
 no suitable constructor found for 
ExplainWork(<nulltype>,<nulltype>,java.util.ArrayList<org.apache.hadoop.hive.ql.exec.Task<?
 extends 
java.io.Serializable>>,org.apache.hadoop.hive.ql.exec.FetchTask,<nulltype>,org.apache.hadoop.hive.ql.parse.ExplainConfiguration,<nulltype>)
[ERROR] constructor org.apache.hadoop.hive.ql.plan.ExplainWork.ExplainWork() is 
not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] constructor 
org.apache.hadoop.hive.ql.plan.ExplainWork.ExplainWork(org.apache.hadoop.fs.Path,org.apache.hadoop.hive.ql.parse.ParseContext,java.util.List<org.apache.hadoop.hive.ql.exec.Task<?
 extends java.io.Serializable>>,org.apache.hadoop.hive.ql.exec.Task<? extends 
java.io.Serializable>,org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer,org.apache.hadoop.hive.ql.parse.ExplainConfiguration,java.lang.String,java.lang.String)
 is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :hive-exec
+ exit 1
'
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12921272 - PreCommit-HIVE-Build

> CBO: Add an "optimizedSQL" to QueryPlan object 
> -----------------------------------------------
>
>                 Key: HIVE-19360
>                 URL: https://issues.apache.org/jira/browse/HIVE-19360
>             Project: Hive
>          Issue Type: Improvement
>          Components: CBO, Diagnosability
>    Affects Versions: 3.1.0
>            Reporter: Gopal V
>            Assignee: Gopal V
>            Priority: Major
>         Attachments: HIVE-19360.1.patch
>
>
> Calcite RelNodes can be converted back into SQL (as the new JDBC storage 
> handler does), which allows Hive to print out the post CBO plan as a SQL 
> query instead of having to guess the join orders from the subsequent Tez plan.
> The query generated might not be always valid SQL at this point, but is a 
> world ahead of DAG plans in readability.
> Eg. tpc-ds Query4 CTEs gets expanded to
> {code}
> SELECT t16.$f3 customer_preferred_cust_flag
> FROM
>   (SELECT t0.c_customer_id $f0,
>                            SUM((t2.ws_ext_list_price - 
> t2.ws_ext_wholesale_cost - t2.ws_ext_discount_amt + t2.ws_ext_sales_price) / 
> CAST(2 AS DECIMAL(10, 0))) $f8
>    FROM
>      (SELECT c_customer_sk,
>              c_customer_id,
>              c_first_name,
>              c_last_name,
>              c_preferred_cust_flag,
>              c_birth_country,
>              c_login,
>              c_email_address
>       FROM default.customer
>       WHERE c_customer_sk IS NOT NULL
>         AND c_customer_id IS NOT NULL) t0
>    INNER JOIN (
>                  (SELECT ws_sold_date_sk,
>                          ws_bill_customer_sk,
>                          ws_ext_discount_amt,
>                          ws_ext_sales_price,
>                          ws_ext_wholesale_cost,
>                          ws_ext_list_price
>                   FROM default.web_sales
>                   WHERE ws_bill_customer_sk IS NOT NULL
>                     AND ws_sold_date_sk IS NOT NULL) t2
>                INNER JOIN
>                  (SELECT d_date_sk,
>                          CAST(2002 AS INTEGER) d_year
>                   FROM default.date_dim
>                   WHERE d_year = 2002
>                     AND d_date_sk IS NOT NULL) t4 ON t2.ws_sold_date_sk = 
> t4.d_date_sk) ON t0.c_customer_sk = t2.ws_bill_customer_sk
>    GROUP BY t0.c_customer_id,
>             t0.c_first_name,
>             t0.c_last_name,
>             t0.c_preferred_cust_flag,
>             t0.c_birth_country,
>             t0.c_login,
>             t0.c_email_address) t7
> INNER JOIN (
>               (SELECT t9.c_customer_id $f0,
>                                        t9.c_preferred_cust_flag $f3,
>                                                                 
> SUM((t11.ss_ext_list_price - t11.ss_ext_wholesale_cost - 
> t11.ss_ext_discount_amt + t11.ss_ext_sales_price) / CAST(2 AS DECIMAL(10, 
> 0))) $f8
>                FROM
>                  (SELECT c_customer_sk,
>                          c_customer_id,
>                          c_first_name,
>                          c_last_name,
>                          c_preferred_cust_flag,
>                          c_birth_country,
>                          c_login,
>                          c_email_address
>                   FROM default.customer
>                   WHERE c_customer_sk IS NOT NULL
>                     AND c_customer_id IS NOT NULL) t9
>                INNER JOIN (
>                              (SELECT ss_sold_date_sk,
>                                      ss_customer_sk,
>                                      ss_ext_discount_amt,
>                                      ss_ext_sales_price,
>                                      ss_ext_wholesale_cost,
>                                      ss_ext_list_price
>                               FROM default.store_sales
>                               WHERE ss_customer_sk IS NOT NULL
>                                 AND ss_sold_date_sk IS NOT NULL) t11
>                            INNER JOIN
>                              (SELECT d_date_sk,
>                                      CAST(2002 AS INTEGER) d_year
>                               FROM default.date_dim
>                               WHERE d_year = 2002
>                                 AND d_date_sk IS NOT NULL) t13 ON 
> t11.ss_sold_date_sk = t13.d_date_sk) ON t9.c_customer_sk = t11.ss_customer_sk
>                GROUP BY t9.c_customer_id,
>                         t9.c_first_name,
>                         t9.c_last_name,
>                         t9.c_preferred_cust_flag,
>                         t9.c_birth_country,
>                         t9.c_login,
>                         t9.c_email_address) t16
>             INNER JOIN (
>                           (SELECT t18.c_customer_id $f0,
>                                                     
> SUM((t20.cs_ext_list_price - t20.cs_ext_wholesale_cost - 
> t20.cs_ext_discount_amt + t20.cs_ext_sales_price) / CAST(2 AS DECIMAL(10, 
> 0))) $f8
>                            FROM
>                              (SELECT c_customer_sk,
>                                      c_customer_id,
>                                      c_first_name,
>                                      c_last_name,
>                                      c_preferred_cust_flag,
>                                      c_birth_country,
>                                      c_login,
>                                      c_email_address
>                               FROM default.customer
>                               WHERE c_customer_sk IS NOT NULL
>                                 AND c_customer_id IS NOT NULL) t18
>                            INNER JOIN (
>                                          (SELECT cs_sold_date_sk,
>                                                  cs_bill_customer_sk,
>                                                  cs_ext_discount_amt,
>                                                  cs_ext_sales_price,
>                                                  cs_ext_wholesale_cost,
>                                                  cs_ext_list_price
>                                           FROM default.catalog_sales
>                                           WHERE cs_bill_customer_sk IS NOT 
> NULL
>                                             AND cs_sold_date_sk IS NOT NULL) 
> t20
>                                        INNER JOIN
>                                          (SELECT d_date_sk,
>                                                  CAST(2002 AS INTEGER) d_year
>                                           FROM default.date_dim
>                                           WHERE d_year = 2002
>                                             AND d_date_sk IS NOT NULL) t22 ON 
> t20.cs_sold_date_sk = t22.d_date_sk) ON t18.c_customer_sk = 
> t20.cs_bill_customer_sk
>                            GROUP BY t18.c_customer_id,
>                                     t18.c_first_name,
>                                     t18.c_last_name,
>                                     t18.c_preferred_cust_flag,
>                                     t18.c_birth_country,
>                                     t18.c_login,
>                                     t18.c_email_address) t25
>                         INNER JOIN
>                           (SELECT t27.c_customer_id $f0,
>                                                     
> SUM((t29.ss_ext_list_price - t29.ss_ext_wholesale_cost - 
> t29.ss_ext_discount_amt + t29.ss_ext_sales_price) / CAST(2 AS DECIMAL(10, 
> 0))) $f8
>                            FROM
>                              (SELECT c_customer_sk,
>                                      c_customer_id,
>                                      c_first_name,
>                                      c_last_name,
>                                      c_preferred_cust_flag,
>                                      c_birth_country,
>                                      c_login,
>                                      c_email_address
>                               FROM default.customer
>                               WHERE c_customer_sk IS NOT NULL
>                                 AND c_customer_id IS NOT NULL) t27
>                            INNER JOIN (
>                                          (SELECT ss_sold_date_sk,
>                                                  ss_customer_sk,
>                                                  ss_ext_discount_amt,
>                                                  ss_ext_sales_price,
>                                                  ss_ext_wholesale_cost,
>                                                  ss_ext_list_price
>                                           FROM default.store_sales
>                                           WHERE ss_customer_sk IS NOT NULL
>                                             AND ss_sold_date_sk IS NOT NULL) 
> t29
>                                        INNER JOIN
>                                          (SELECT d_date_sk,
>                                                  CAST(2001 AS INTEGER) d_year
>                                           FROM default.date_dim
>                                           WHERE d_year = 2001
>                                             AND d_date_sk IS NOT NULL) t31 ON 
> t29.ss_sold_date_sk = t31.d_date_sk) ON t27.c_customer_sk = t29.ss_customer_sk
>                            GROUP BY t27.c_customer_id,
>                                     t27.c_first_name,
>                                     t27.c_last_name,
>                                     t27.c_preferred_cust_flag,
>                                     t27.c_birth_country,
>                                     t27.c_login,
>                                     t27.c_email_address
>                            HAVING SUM((t29.ss_ext_list_price - 
> t29.ss_ext_wholesale_cost - t29.ss_ext_discount_amt + t29.ss_ext_sales_price) 
> / CAST(2 AS DECIMAL(10, 0))) > 0) t35 ON t25.$f0 = t35.$f0) ON t16.$f0 = 
> t35.$f0
>             INNER JOIN
>               (SELECT t37.c_customer_id $f0,
>                                         SUM((t39.cs_ext_list_price - 
> t39.cs_ext_wholesale_cost - t39.cs_ext_discount_amt + t39.cs_ext_sales_price) 
> / CAST(2 AS DECIMAL(10, 0))) $f8
>                FROM
>                  (SELECT c_customer_sk,
>                          c_customer_id,
>                          c_first_name,
>                          c_last_name,
>                          c_preferred_cust_flag,
>                          c_birth_country,
>                          c_login,
>                          c_email_address
>                   FROM default.customer
>                   WHERE c_customer_sk IS NOT NULL
>                     AND c_customer_id IS NOT NULL) t37
>                INNER JOIN (
>                              (SELECT cs_sold_date_sk,
>                                      cs_bill_customer_sk,
>                                      cs_ext_discount_amt,
>                                      cs_ext_sales_price,
>                                      cs_ext_wholesale_cost,
>                                      cs_ext_list_price
>                               FROM default.catalog_sales
>                               WHERE cs_bill_customer_sk IS NOT NULL
>                                 AND cs_sold_date_sk IS NOT NULL) t39
>                            INNER JOIN
>                              (SELECT d_date_sk,
>                                      CAST(2001 AS INTEGER) d_year
>                               FROM default.date_dim
>                               WHERE d_year = 2001
>                                 AND d_date_sk IS NOT NULL) t41 ON 
> t39.cs_sold_date_sk = t41.d_date_sk) ON t37.c_customer_sk = 
> t39.cs_bill_customer_sk
>                GROUP BY t37.c_customer_id,
>                         t37.c_first_name,
>                         t37.c_last_name,
>                         t37.c_preferred_cust_flag,
>                         t37.c_birth_country,
>                         t37.c_login,
>                         t37.c_email_address
>                HAVING SUM((t39.cs_ext_list_price - t39.cs_ext_wholesale_cost 
> - t39.cs_ext_discount_amt + t39.cs_ext_sales_price) / CAST(2 AS DECIMAL(10, 
> 0))) > 0) t45 ON t25.$f8 / t45.$f8 > t16.$f8 / t35.$f8
>             AND t35.$f0 = t45.$f0) ON t7.$f0 = t35.$f0
> INNER JOIN
>   (SELECT t47.c_customer_id $f0,
>                             SUM((t49.ws_ext_list_price - 
> t49.ws_ext_wholesale_cost - t49.ws_ext_discount_amt + t49.ws_ext_sales_price) 
> / CAST(2 AS DECIMAL(10, 0))) $f8
>    FROM
>      (SELECT c_customer_sk,
>              c_customer_id,
>              c_first_name,
>              c_last_name,
>              c_preferred_cust_flag,
>              c_birth_country,
>              c_login,
>              c_email_address
>       FROM default.customer
>       WHERE c_customer_sk IS NOT NULL
>         AND c_customer_id IS NOT NULL) t47
>    INNER JOIN (
>                  (SELECT ws_sold_date_sk,
>                          ws_bill_customer_sk,
>                          ws_ext_discount_amt,
>                          ws_ext_sales_price,
>                          ws_ext_wholesale_cost,
>                          ws_ext_list_price
>                   FROM default.web_sales
>                   WHERE ws_bill_customer_sk IS NOT NULL
>                     AND ws_sold_date_sk IS NOT NULL) t49
>                INNER JOIN
>                  (SELECT d_date_sk,
>                          CAST(2001 AS INTEGER) d_year
>                   FROM default.date_dim
>                   WHERE d_year = 2001
>                     AND d_date_sk IS NOT NULL) t51 ON t49.ws_sold_date_sk = 
> t51.d_date_sk) ON t47.c_customer_sk = t49.ws_bill_customer_sk
>    GROUP BY t47.c_customer_id,
>             t47.c_first_name,
>             t47.c_last_name,
>             t47.c_preferred_cust_flag,
>             t47.c_birth_country,
>             t47.c_login,
>             t47.c_email_address
>    HAVING SUM((t49.ws_ext_list_price - t49.ws_ext_wholesale_cost - 
> t49.ws_ext_discount_amt + t49.ws_ext_sales_price) / CAST(2 AS DECIMAL(10, 
> 0))) > 0) t55 ON t25.$f8 / t45.$f8 > t7.$f8 / t55.$f8
> AND t35.$f0 = t55.$f0
> ORDER BY t16.$f3 IS NULL DESC, t16.$f3
> LIMIT 100
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to