diff --git a/data/conf/jdbc/hive-site.xml b/data/conf/jdbc/hive-site.xml new file mode 100644 index 000000000000..7a18c75561c3 --- /dev/null +++ b/data/conf/jdbc/hive-site.xml @@ -0,0 +1,398 @@ + + + + + + + + hive.metastore.client.cache.enabled + true + This property enables a Caffeiene Cache for Metastore client + + + + hive.in.test + true + Internal marker for test. Used for masking env-dependent values + + + + + + + + + + + hadoop.tmp.dir + ${test.tmp.dir}/hadoop-tmp + A base for other temporary directories. + + + + + + + hive.tez.container.size + 256 + + + + hive.stats.fetch.column.stats + true + Use column stats to annotate stats for physical optimization phase + + + + hive.merge.tezfiles + false + Merge small files at the end of a Tez DAG + + + + hive.tez.input.format + org.apache.hadoop.hive.ql.io.HiveInputFormat + The default input format for tez. Tez groups splits in the AM. + + + + hive.exec.scratchdir + ${test.tmp.dir}/scratchdir + Scratch space for Hive jobs + + + + hive.exec.local.scratchdir + ${test.tmp.dir}/localscratchdir/ + Local scratch space for Hive jobs + + + + datanucleus.schema.autoCreateAll + true + + + + datanucleus.connectionPool.maxPoolSize + 4 + + + + hive.metastore.schema.verification + false + + + + javax.jdo.option.ConnectionURL + jdbc:derby:memory:${test.tmp.dir}/junit_metastore_db;create=true + + + + javax.jdo.option.ConnectionDriverName + org.apache.derby.iapi.jdbc.AutoloadedDriver + + + + javax.jdo.option.ConnectionUserName + APP + + + + javax.jdo.option.ConnectionPassword + mine + + + + + hive.metastore.warehouse.dir + ${test.warehouse.dir} + + + + + test.log.dir + ${test.tmp.dir}/log/ + + + + + test.data.files + ${hive.root}/data/files + + + + + test.data.scripts + ${hive.root}/data/scripts + + + + + hive.jar.path + ${maven.local.repository}/org/apache/hive/hive-exec/${hive.version}/hive-exec-${hive.version}.jar + + + + + hive.metastore.rawstore.impl + org.apache.hadoop.hive.metastore.ObjectStore + Name of the class that implements org.apache.hadoop.hive.metastore.rawstore interface. This class is used to store and retrieval of raw metadata objects such as table, database + + + + hive.querylog.location + ${test.tmp.dir}/tmp + Location of the structured hive logs + + + + hive.lineage.statement.filter + ALL + Specify the types of statements for which column lineage information is generated + + + + hive.support.concurrency + false + Whether hive supports concurrency or not. A zookeeper instance must be up and running for the default hive lock manager to support read-write locks. + + + + fs.pfile.impl + org.apache.hadoop.fs.ProxyLocalFileSystem + A proxy for local file system used for cross file system testing + + + + hive.exec.mode.local.auto + false + + Let hive determine whether to run in local mode automatically + Disabling this for tests so that minimr is not affected + + + + + hive.auto.convert.join + false + Whether Hive enable the optimization about converting common join into mapjoin based on the input file size + + + + hive.ignore.mapjoin.hint + true + Whether Hive ignores the mapjoin hint + + + + io.sort.mb + 10 + + + + hive.input.format + org.apache.hadoop.hive.ql.io.CombineHiveInputFormat + The default input format, if it is not specified, the system assigns it. It is set to HiveInputFormat for hadoop versions 17, 18 and 19, whereas it is set to CombineHiveInputFormat for hadoop 20. The user can always overwrite it - if there is a bug in CombineHiveInputFormat, it can always be manually set to HiveInputFormat. + + + + hive.default.rcfile.serde + org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe + The default SerDe hive will use for the rcfile format + + + + hive.stats.dbclass + fs + The default storatge that stores temporary hive statistics. Currently, fs type is supported + + + + tez.am.node-blacklisting.enabled + false + + + + hive.prewarm.enabled + false + + Enables container prewarm for tez (hadoop 2 only) + + + + hive.in.tez.test + true + + Indicates that we are in tez testing mode. + + + + + hive.execution.mode + llap + + + + + + hive.tez.java.opts + -Dlog4j.configurationFile=tez-container-log4j2.properties -Dtez.container.log.level=INFO -Dtez.container.root.logger=CLA + + + + tez.am.launch.cmd-opts + -Dlog4j.configurationFile=tez-container-log4j2.properties -Dtez.container.log.level=INFO -Dtez.container.root.logger=CLA + + + + hive.tez.exec.print.summary + true + + + + hive.llap.cache.allow.synthetic.fileid + true + + + + hive.llap.io.allocator.direct + false + + + + hive.explain.user + false + + + hive.explain.formatted.indent + true + + + hive.join.inner.residual + true + + + + + + hive.llap.daemon.service.hosts + localhost + + + + hive.llap.daemon.service.port + 0 + + + + hive.llap.daemon.num.executors + 4 + + + + hive.llap.daemon.task.scheduler.wait.queue.size + 4 + + + + hive.llap.cache.allow.synthetic.fileid + true + + + + + ipc.client.low-latency + true + + + + ipc.client.tcpnodelay + true + + + + ipc.clients-per-factory + 4 + + + + hive.stats.fetch.bitvector + true + + + + hive.tez.cartesian-product.enabled + true + + + + yarn.nodemanager.disk-health-checker.max-disk-utilization-per-disk-percentage + 99 + + + + hive.query.results.cache.enabled + false + + + + tez.counters.max + 1024 + + + + hive.query.reexecution.stats.persist.scope + query + + + + hive.semantic.analyzer.hook + org.apache.hadoop.hive.ql.hooks.ScheduledQueryCreationRegistryHook + + + + hive.users.in.admin.role + hive_admin_user + + + + hive.conf.restricted.list + hive.query.max.length + Using property defined in HiveConf.ConfVars to test System property overriding + + + + hive.strict.timestamp.conversion + false + + + + hive.txn.xlock.ctas + false + + + + hive.lock.sleep.between.retries + 2 + + + diff --git a/data/conf/jdbc/metastore-site.xml b/data/conf/jdbc/metastore-site.xml new file mode 100644 index 000000000000..4b4da2f437a5 --- /dev/null +++ b/data/conf/jdbc/metastore-site.xml @@ -0,0 +1,33 @@ + + + + + + + + metastore.metadata.transformer.class + + + + + metastore.lock.sleep.between.retries + 2 + + + + diff --git a/data/conf/jdbc/tez-site.xml b/data/conf/jdbc/tez-site.xml new file mode 100644 index 000000000000..8e6d243fa3ae --- /dev/null +++ b/data/conf/jdbc/tez-site.xml @@ -0,0 +1,53 @@ + + + + + + tez.am.dag.scheduler.class + org.apache.tez.dag.app.dag.impl.DAGSchedulerNaturalOrderControlled + + + + tez.am.resource.memory.mb + 256 + + + tez.runtime.io.sort.mb + 24 + + + tez.runtime.unordered.output.buffer.size-mb + 10 + + + tez.runtime.shuffle.fetch.buffer.percent + 0.4 + + + + + tez.am.task.max.failed.attempts + 2 + + + tez.runtime.shuffle.connect.timeout + 20000 + + + + diff --git a/data/scripts/q_test_tpcds_external_tables_schema.postgres.sql b/data/scripts/q_test_tpcds_external_tables_schema.postgres.sql new file mode 100644 index 000000000000..9f2ab5fdf144 --- /dev/null +++ b/data/scripts/q_test_tpcds_external_tables_schema.postgres.sql @@ -0,0 +1,712 @@ +CREATE EXTERNAL TABLE IF NOT EXISTS `call_center`( + `cc_call_center_sk` int, + `cc_call_center_id` string, + `cc_rec_start_date` string, + `cc_rec_end_date` string, + `cc_closed_date_sk` int, + `cc_open_date_sk` int, + `cc_name` string, + `cc_class` string, + `cc_employees` int, + `cc_sq_ft` int, + `cc_hours` string, + `cc_manager` string, + `cc_mkt_id` int, + `cc_mkt_class` string, + `cc_mkt_desc` string, + `cc_market_manager` string, + `cc_division` int, + `cc_division_name` string, + `cc_company` int, + `cc_company_name` string, + `cc_street_number` string, + `cc_street_name` string, + `cc_street_type` string, + `cc_suite_number` string, + `cc_city` string, + `cc_county` string, + `cc_state` string, + `cc_zip` string, + `cc_country` string, + `cc_gmt_offset` decimal(5,2), + `cc_tax_percentage` decimal(5,2)) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "call_center" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `catalog_page`( + `cp_catalog_page_sk` int, + `cp_catalog_page_id` string, + `cp_start_date_sk` int, + `cp_end_date_sk` int, + `cp_department` string, + `cp_catalog_number` int, + `cp_catalog_page_number` int, + `cp_description` string, + `cp_type` string) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "catalog_page" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `catalog_returns`( + `cr_returned_date_sk` int, + `cr_returned_time_sk` int, + `cr_item_sk` bigint, + `cr_refunded_customer_sk` int, + `cr_refunded_cdemo_sk` int, + `cr_refunded_hdemo_sk` int, + `cr_refunded_addr_sk` int, + `cr_returning_customer_sk` int, + `cr_returning_cdemo_sk` int, + `cr_returning_hdemo_sk` int, + `cr_returning_addr_sk` int, + `cr_call_center_sk` int, + `cr_catalog_page_sk` int, + `cr_ship_mode_sk` int, + `cr_warehouse_sk` int, + `cr_reason_sk` int, + `cr_order_number` bigint, + `cr_return_quantity` int, + `cr_return_amount` decimal(7,2), + `cr_return_tax` decimal(7,2), + `cr_return_amt_inc_tax` decimal(7,2), + `cr_fee` decimal(7,2), + `cr_return_ship_cost` decimal(7,2), + `cr_refunded_cash` decimal(7,2), + `cr_reversed_charge` decimal(7,2), + `cr_store_credit` decimal(7,2), + `cr_net_loss` decimal(7,2)) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "catalog_returns" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `catalog_sales`( + `cs_sold_date_sk` int, + `cs_sold_time_sk` int, + `cs_ship_date_sk` int, + `cs_bill_customer_sk` int, + `cs_bill_cdemo_sk` int, + `cs_bill_hdemo_sk` int, + `cs_bill_addr_sk` int, + `cs_ship_customer_sk` int, + `cs_ship_cdemo_sk` int, + `cs_ship_hdemo_sk` int, + `cs_ship_addr_sk` int, + `cs_call_center_sk` int, + `cs_catalog_page_sk` int, + `cs_ship_mode_sk` int, + `cs_warehouse_sk` int, + `cs_item_sk` bigint, + `cs_promo_sk` int, + `cs_order_number` bigint, + `cs_quantity` int, + `cs_wholesale_cost` decimal(7,2), + `cs_list_price` decimal(7,2), + `cs_sales_price` decimal(7,2), + `cs_ext_discount_amt` decimal(7,2), + `cs_ext_sales_price` decimal(7,2), + `cs_ext_wholesale_cost` decimal(7,2), + `cs_ext_list_price` decimal(7,2), + `cs_ext_tax` decimal(7,2), + `cs_coupon_amt` decimal(7,2), + `cs_ext_ship_cost` decimal(7,2), + `cs_net_paid` decimal(7,2), + `cs_net_paid_inc_tax` decimal(7,2), + `cs_net_paid_inc_ship` decimal(7,2), + `cs_net_paid_inc_ship_tax` decimal(7,2), + `cs_net_profit` decimal(7,2)) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "catalog_sales" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `customer`( + `c_customer_sk` int, + `c_customer_id` string, + `c_current_cdemo_sk` int, + `c_current_hdemo_sk` int, + `c_current_addr_sk` int, + `c_first_shipto_date_sk` int, + `c_first_sales_date_sk` int, + `c_salutation` string, + `c_first_name` string, + `c_last_name` string, + `c_preferred_cust_flag` string, + `c_birth_day` int, + `c_birth_month` int, + `c_birth_year` int, + `c_birth_country` string, + `c_login` string, + `c_email_address` string, + `c_last_review_date_sk` string) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "customer" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `customer_address`( + `ca_address_sk` int, + `ca_address_id` string, + `ca_street_number` string, + `ca_street_name` string, + `ca_street_type` string, + `ca_suite_number` string, + `ca_city` string, + `ca_county` string, + `ca_state` string, + `ca_zip` string, + `ca_country` string, + `ca_gmt_offset` decimal(5,2), + `ca_location_type` string) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "customer_address" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `customer_demographics`( + `cd_demo_sk` int, + `cd_gender` string, + `cd_marital_status` string, + `cd_education_status` string, + `cd_purchase_estimate` int, + `cd_credit_rating` string, + `cd_dep_count` int, + `cd_dep_employed_count` int, + `cd_dep_college_count` int) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "customer_demographics" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `date_dim`( + `d_date_sk` int, + `d_date_id` string, + `d_date` string, + `d_month_seq` int, + `d_week_seq` int, + `d_quarter_seq` int, + `d_year` int, + `d_dow` int, + `d_moy` int, + `d_dom` int, + `d_qoy` int, + `d_fy_year` int, + `d_fy_quarter_seq` int, + `d_fy_week_seq` int, + `d_day_name` string, + `d_quarter_name` string, + `d_holiday` string, + `d_weekend` string, + `d_following_holiday` string, + `d_first_dom` int, + `d_last_dom` int, + `d_same_day_ly` int, + `d_same_day_lq` int, + `d_current_day` string, + `d_current_week` string, + `d_current_month` string, + `d_current_quarter` string, + `d_current_year` string) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "date_dim" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `household_demographics`( + `hd_demo_sk` int, + `hd_income_band_sk` int, + `hd_buy_potential` string, + `hd_dep_count` int, + `hd_vehicle_count` int) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "household_demographics" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `income_band`( + `ib_income_band_sk` int, + `ib_lower_bound` int, + `ib_upper_bound` int) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "income_band" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `inventory`( + `inv_date_sk` int, + `inv_item_sk` bigint, + `inv_warehouse_sk` int, + `inv_quantity_on_hand` int) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "inventory" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `item`( + `i_item_sk` bigint, + `i_item_id` string, + `i_rec_start_date` string, + `i_rec_end_date` string, + `i_item_desc` string, + `i_current_price` decimal(7,2), + `i_wholesale_cost` decimal(7,2), + `i_brand_id` int, + `i_brand` string, + `i_class_id` int, + `i_class` string, + `i_category_id` int, + `i_category` string, + `i_manufact_id` int, + `i_manufact` string, + `i_size` string, + `i_formulation` string, + `i_color` string, + `i_units` string, + `i_container` string, + `i_manager_id` int, + `i_product_name` string) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "item" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `promotion`( + `p_promo_sk` int, + `p_promo_id` string, + `p_start_date_sk` int, + `p_end_date_sk` int, + `p_item_sk` bigint, + `p_cost` decimal(15,2), + `p_response_target` int, + `p_promo_name` string, + `p_channel_dmail` string, + `p_channel_email` string, + `p_channel_catalog` string, + `p_channel_tv` string, + `p_channel_radio` string, + `p_channel_press` string, + `p_channel_event` string, + `p_channel_demo` string, + `p_channel_details` string, + `p_purpose` string, + `p_discount_active` string) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "promotion" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `reason`( + `r_reason_sk` int, + `r_reason_id` string, + `r_reason_desc` string) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "reason" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `ship_mode`( + `sm_ship_mode_sk` int, + `sm_ship_mode_id` string, + `sm_type` string, + `sm_code` string, + `sm_carrier` string, + `sm_contract` string) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "ship_mode" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `store`( + `s_store_sk` int, + `s_store_id` string, + `s_rec_start_date` string, + `s_rec_end_date` string, + `s_closed_date_sk` int, + `s_store_name` string, + `s_number_employees` int, + `s_floor_space` int, + `s_hours` string, + `s_manager` string, + `s_market_id` int, + `s_geography_class` string, + `s_market_desc` string, + `s_market_manager` string, + `s_division_id` int, + `s_division_name` string, + `s_company_id` int, + `s_company_name` string, + `s_street_number` string, + `s_street_name` string, + `s_street_type` string, + `s_suite_number` string, + `s_city` string, + `s_county` string, + `s_state` string, + `s_zip` string, + `s_country` string, + `s_gmt_offset` decimal(5,2), + `s_tax_precentage` decimal(5,2)) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "store" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `store_returns`( + `sr_returned_date_sk` int, + `sr_return_time_sk` int, + `sr_item_sk` bigint, + `sr_customer_sk` int, + `sr_cdemo_sk` int, + `sr_hdemo_sk` int, + `sr_addr_sk` int, + `sr_store_sk` int, + `sr_reason_sk` int, + `sr_ticket_number` bigint, + `sr_return_quantity` int, + `sr_return_amt` decimal(7,2), + `sr_return_tax` decimal(7,2), + `sr_return_amt_inc_tax` decimal(7,2), + `sr_fee` decimal(7,2), + `sr_return_ship_cost` decimal(7,2), + `sr_refunded_cash` decimal(7,2), + `sr_reversed_charge` decimal(7,2), + `sr_store_credit` decimal(7,2), + `sr_net_loss` decimal(7,2)) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "store_returns" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `store_sales`( + `ss_sold_date_sk` int, + `ss_sold_time_sk` int, + `ss_item_sk` bigint, + `ss_customer_sk` int, + `ss_cdemo_sk` int, + `ss_hdemo_sk` int, + `ss_addr_sk` int, + `ss_store_sk` int, + `ss_promo_sk` int, + `ss_ticket_number` bigint, + `ss_quantity` int, + `ss_wholesale_cost` decimal(7,2), + `ss_list_price` decimal(7,2), + `ss_sales_price` decimal(7,2), + `ss_ext_discount_amt` decimal(7,2), + `ss_ext_sales_price` decimal(7,2), + `ss_ext_wholesale_cost` decimal(7,2), + `ss_ext_list_price` decimal(7,2), + `ss_ext_tax` decimal(7,2), + `ss_coupon_amt` decimal(7,2), + `ss_net_paid` decimal(7,2), + `ss_net_paid_inc_tax` decimal(7,2), + `ss_net_profit` decimal(7,2)) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "store_sales" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `time_dim`( + `t_time_sk` int, + `t_time_id` string, + `t_time` int, + `t_hour` int, + `t_minute` int, + `t_second` int, + `t_am_pm` string, + `t_shift` string, + `t_sub_shift` string, + `t_meal_time` string) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "time_dim" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `warehouse`( + `w_warehouse_sk` int, + `w_warehouse_id` string, + `w_warehouse_name` string, + `w_warehouse_sq_ft` int, + `w_street_number` string, + `w_street_name` string, + `w_street_type` string, + `w_suite_number` string, + `w_city` string, + `w_county` string, + `w_state` string, + `w_zip` string, + `w_country` string, + `w_gmt_offset` decimal(5,2)) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "warehouse" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `web_page`( + `wp_web_page_sk` int, + `wp_web_page_id` string, + `wp_rec_start_date` string, + `wp_rec_end_date` string, + `wp_creation_date_sk` int, + `wp_access_date_sk` int, + `wp_autogen_flag` string, + `wp_customer_sk` int, + `wp_url` string, + `wp_type` string, + `wp_char_count` int, + `wp_link_count` int, + `wp_image_count` int, + `wp_max_ad_count` int) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "web_page" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `web_returns`( + `wr_returned_date_sk` int, + `wr_returned_time_sk` int, + `wr_item_sk` bigint, + `wr_refunded_customer_sk` int, + `wr_refunded_cdemo_sk` int, + `wr_refunded_hdemo_sk` int, + `wr_refunded_addr_sk` int, + `wr_returning_customer_sk` int, + `wr_returning_cdemo_sk` int, + `wr_returning_hdemo_sk` int, + `wr_returning_addr_sk` int, + `wr_web_page_sk` int, + `wr_reason_sk` int, + `wr_order_number` bigint, + `wr_return_quantity` int, + `wr_return_amt` decimal(7,2), + `wr_return_tax` decimal(7,2), + `wr_return_amt_inc_tax` decimal(7,2), + `wr_fee` decimal(7,2), + `wr_return_ship_cost` decimal(7,2), + `wr_refunded_cash` decimal(7,2), + `wr_reversed_charge` decimal(7,2), + `wr_account_credit` decimal(7,2), + `wr_net_loss` decimal(7,2)) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "web_returns" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `web_sales`( + `ws_sold_date_sk` int, + `ws_sold_time_sk` int, + `ws_ship_date_sk` int, + `ws_item_sk` bigint, + `ws_bill_customer_sk` int, + `ws_bill_cdemo_sk` int, + `ws_bill_hdemo_sk` int, + `ws_bill_addr_sk` int, + `ws_ship_customer_sk` int, + `ws_ship_cdemo_sk` int, + `ws_ship_hdemo_sk` int, + `ws_ship_addr_sk` int, + `ws_web_page_sk` int, + `ws_web_site_sk` int, + `ws_ship_mode_sk` int, + `ws_warehouse_sk` int, + `ws_promo_sk` int, + `ws_order_number` bigint, + `ws_quantity` int, + `ws_wholesale_cost` decimal(7,2), + `ws_list_price` decimal(7,2), + `ws_sales_price` decimal(7,2), + `ws_ext_discount_amt` decimal(7,2), + `ws_ext_sales_price` decimal(7,2), + `ws_ext_wholesale_cost` decimal(7,2), + `ws_ext_list_price` decimal(7,2), + `ws_ext_tax` decimal(7,2), + `ws_coupon_amt` decimal(7,2), + `ws_ext_ship_cost` decimal(7,2), + `ws_net_paid` decimal(7,2), + `ws_net_paid_inc_tax` decimal(7,2), + `ws_net_paid_inc_ship` decimal(7,2), + `ws_net_paid_inc_ship_tax` decimal(7,2), + `ws_net_profit` decimal(7,2)) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "web_sales" +); + +CREATE EXTERNAL TABLE IF NOT EXISTS `web_site`( + `web_site_sk` int, + `web_site_id` string, + `web_rec_start_date` string, + `web_rec_end_date` string, + `web_name` string, + `web_open_date_sk` int, + `web_close_date_sk` int, + `web_class` string, + `web_manager` string, + `web_mkt_id` int, + `web_mkt_class` string, + `web_mkt_desc` string, + `web_market_manager` string, + `web_company_id` int, + `web_company_name` string, + `web_street_number` string, + `web_street_name` string, + `web_street_type` string, + `web_suite_number` string, + `web_city` string, + `web_county` string, + `web_state` string, + `web_zip` string, + `web_country` string, + `web_gmt_offset` decimal(5,2), + `web_tax_percentage` decimal(5,2)) +STORED BY +'org.apache.hive.storage.jdbc.JdbcStorageHandler' +TBLPROPERTIES ( + "hive.sql.database.type" = "POSTGRES", + "hive.sql.jdbc.driver" = "org.postgresql.Driver", + "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", + "hive.sql.dbcp.username" = "qtestuser", + "hive.sql.dbcp.password" = "qtestpassword", + "hive.sql.table" = "web_site" +); diff --git a/data/scripts/q_test_tpcds_schema.postgres.sql b/data/scripts/q_test_tpcds_schema.postgres.sql new file mode 100644 index 000000000000..f58ce9a65441 --- /dev/null +++ b/data/scripts/q_test_tpcds_schema.postgres.sql @@ -0,0 +1,472 @@ +CREATE TABLE IF NOT EXISTS call_center( + cc_call_center_sk int, + cc_call_center_id text, + cc_rec_start_date text, + cc_rec_end_date text, + cc_closed_date_sk int, + cc_open_date_sk int, + cc_name text, + cc_class text, + cc_employees int, + cc_sq_ft int, + cc_hours text, + cc_manager text, + cc_mkt_id int, + cc_mkt_class text, + cc_mkt_desc text, + cc_market_manager text, + cc_division int, + cc_division_name text, + cc_company int, + cc_company_name text, + cc_street_number text, + cc_street_name text, + cc_street_type text, + cc_suite_number text, + cc_city text, + cc_county text, + cc_state text, + cc_zip text, + cc_country text, + cc_gmt_offset numeric(5,2), + cc_tax_percentage numeric(5,2)); + +CREATE TABLE IF NOT EXISTS catalog_page( + cp_catalog_page_sk int, + cp_catalog_page_id text, + cp_start_date_sk int, + cp_end_date_sk int, + cp_department text, + cp_catalog_number int, + cp_catalog_page_number int, + cp_description text, + cp_type text); + +CREATE TABLE IF NOT EXISTS catalog_returns( + cr_returned_date_sk int, + cr_returned_time_sk int, + cr_item_sk bigint, + cr_refunded_customer_sk int, + cr_refunded_cdemo_sk int, + cr_refunded_hdemo_sk int, + cr_refunded_addr_sk int, + cr_returning_customer_sk int, + cr_returning_cdemo_sk int, + cr_returning_hdemo_sk int, + cr_returning_addr_sk int, + cr_call_center_sk int, + cr_catalog_page_sk int, + cr_ship_mode_sk int, + cr_warehouse_sk int, + cr_reason_sk int, + cr_order_number bigint, + cr_return_quantity int, + cr_return_amount numeric(7,2), + cr_return_tax numeric(7,2), + cr_return_amt_inc_tax numeric(7,2), + cr_fee numeric(7,2), + cr_return_ship_cost numeric(7,2), + cr_refunded_cash numeric(7,2), + cr_reversed_charge numeric(7,2), + cr_store_credit numeric(7,2), + cr_net_loss numeric(7,2)); + +CREATE TABLE IF NOT EXISTS catalog_sales( + cs_sold_date_sk int, + cs_sold_time_sk int, + cs_ship_date_sk int, + cs_bill_customer_sk int, + cs_bill_cdemo_sk int, + cs_bill_hdemo_sk int, + cs_bill_addr_sk int, + cs_ship_customer_sk int, + cs_ship_cdemo_sk int, + cs_ship_hdemo_sk int, + cs_ship_addr_sk int, + cs_call_center_sk int, + cs_catalog_page_sk int, + cs_ship_mode_sk int, + cs_warehouse_sk int, + cs_item_sk bigint, + cs_promo_sk int, + cs_order_number bigint, + cs_quantity int, + cs_wholesale_cost numeric(7,2), + cs_list_price numeric(7,2), + cs_sales_price numeric(7,2), + cs_ext_discount_amt numeric(7,2), + cs_ext_sales_price numeric(7,2), + cs_ext_wholesale_cost numeric(7,2), + cs_ext_list_price numeric(7,2), + cs_ext_tax numeric(7,2), + cs_coupon_amt numeric(7,2), + cs_ext_ship_cost numeric(7,2), + cs_net_paid numeric(7,2), + cs_net_paid_inc_tax numeric(7,2), + cs_net_paid_inc_ship numeric(7,2), + cs_net_paid_inc_ship_tax numeric(7,2), + cs_net_profit numeric(7,2)); + +CREATE TABLE IF NOT EXISTS customer( + c_customer_sk int, + c_customer_id text, + c_current_cdemo_sk int, + c_current_hdemo_sk int, + c_current_addr_sk int, + c_first_shipto_date_sk int, + c_first_sales_date_sk int, + c_salutation text, + c_first_name text, + c_last_name text, + c_preferred_cust_flag text, + c_birth_day int, + c_birth_month int, + c_birth_year int, + c_birth_country text, + c_login text, + c_email_address text, + c_last_review_date_sk text); + +CREATE TABLE IF NOT EXISTS customer_address( + ca_address_sk int, + ca_address_id text, + ca_street_number text, + ca_street_name text, + ca_street_type text, + ca_suite_number text, + ca_city text, + ca_county text, + ca_state text, + ca_zip text, + ca_country text, + ca_gmt_offset numeric(5,2), + ca_location_type text); + +CREATE TABLE IF NOT EXISTS customer_demographics( + cd_demo_sk int, + cd_gender text, + cd_marital_status text, + cd_education_status text, + cd_purchase_estimate int, + cd_credit_rating text, + cd_dep_count int, + cd_dep_employed_count int, + cd_dep_college_count int); + +CREATE TABLE IF NOT EXISTS date_dim( + d_date_sk int, + d_date_id text, + d_date text, + d_month_seq int, + d_week_seq int, + d_quarter_seq int, + d_year int, + d_dow int, + d_moy int, + d_dom int, + d_qoy int, + d_fy_year int, + d_fy_quarter_seq int, + d_fy_week_seq int, + d_day_name text, + d_quarter_name text, + d_holiday text, + d_weekend text, + d_following_holiday text, + d_first_dom int, + d_last_dom int, + d_same_day_ly int, + d_same_day_lq int, + d_current_day text, + d_current_week text, + d_current_month text, + d_current_quarter text, + d_current_year text); + +CREATE TABLE IF NOT EXISTS household_demographics( + hd_demo_sk int, + hd_income_band_sk int, + hd_buy_potential text, + hd_dep_count int, + hd_vehicle_count int); + +CREATE TABLE IF NOT EXISTS income_band( + ib_income_band_sk int, + ib_lower_bound int, + ib_upper_bound int); + +CREATE TABLE IF NOT EXISTS inventory( + inv_date_sk int, + inv_item_sk bigint, + inv_warehouse_sk int, + inv_quantity_on_hand int); + +CREATE TABLE IF NOT EXISTS item( + i_item_sk bigint, + i_item_id text, + i_rec_start_date text, + i_rec_end_date text, + i_item_desc text, + i_current_price numeric(7,2), + i_wholesale_cost numeric(7,2), + i_brand_id int, + i_brand text, + i_class_id int, + i_class text, + i_category_id int, + i_category text, + i_manufact_id int, + i_manufact text, + i_size text, + i_formulation text, + i_color text, + i_units text, + i_container text, + i_manager_id int, + i_product_name text); + +CREATE TABLE IF NOT EXISTS promotion( + p_promo_sk int, + p_promo_id text, + p_start_date_sk int, + p_end_date_sk int, + p_item_sk bigint, + p_cost numeric(15,2), + p_response_target int, + p_promo_name text, + p_channel_dmail text, + p_channel_email text, + p_channel_catalog text, + p_channel_tv text, + p_channel_radio text, + p_channel_press text, + p_channel_event text, + p_channel_demo text, + p_channel_details text, + p_purpose text, + p_discount_active text); + +CREATE TABLE IF NOT EXISTS reason( + r_reason_sk int, + r_reason_id text, + r_reason_desc text); + +CREATE TABLE IF NOT EXISTS ship_mode( + sm_ship_mode_sk int, + sm_ship_mode_id text, + sm_type text, + sm_code text, + sm_carrier text, + sm_contract text); + +CREATE TABLE IF NOT EXISTS store( + s_store_sk int, + s_store_id text, + s_rec_start_date text, + s_rec_end_date text, + s_closed_date_sk int, + s_store_name text, + s_number_employees int, + s_floor_space int, + s_hours text, + s_manager text, + s_market_id int, + s_geography_class text, + s_market_desc text, + s_market_manager text, + s_division_id int, + s_division_name text, + s_company_id int, + s_company_name text, + s_street_number text, + s_street_name text, + s_street_type text, + s_suite_number text, + s_city text, + s_county text, + s_state text, + s_zip text, + s_country text, + s_gmt_offset numeric(5,2), + s_tax_precentage numeric(5,2)); + +CREATE TABLE IF NOT EXISTS store_returns( + sr_returned_date_sk int, + sr_return_time_sk int, + sr_item_sk bigint, + sr_customer_sk int, + sr_cdemo_sk int, + sr_hdemo_sk int, + sr_addr_sk int, + sr_store_sk int, + sr_reason_sk int, + sr_ticket_number bigint, + sr_return_quantity int, + sr_return_amt numeric(7,2), + sr_return_tax numeric(7,2), + sr_return_amt_inc_tax numeric(7,2), + sr_fee numeric(7,2), + sr_return_ship_cost numeric(7,2), + sr_refunded_cash numeric(7,2), + sr_reversed_charge numeric(7,2), + sr_store_credit numeric(7,2), + sr_net_loss numeric(7,2)); + +CREATE TABLE IF NOT EXISTS store_sales( + ss_sold_date_sk int, + ss_sold_time_sk int, + ss_item_sk bigint, + ss_customer_sk int, + ss_cdemo_sk int, + ss_hdemo_sk int, + ss_addr_sk int, + ss_store_sk int, + ss_promo_sk int, + ss_ticket_number bigint, + ss_quantity int, + ss_wholesale_cost numeric(7,2), + ss_list_price numeric(7,2), + ss_sales_price numeric(7,2), + ss_ext_discount_amt numeric(7,2), + ss_ext_sales_price numeric(7,2), + ss_ext_wholesale_cost numeric(7,2), + ss_ext_list_price numeric(7,2), + ss_ext_tax numeric(7,2), + ss_coupon_amt numeric(7,2), + ss_net_paid numeric(7,2), + ss_net_paid_inc_tax numeric(7,2), + ss_net_profit numeric(7,2)); + +CREATE TABLE IF NOT EXISTS time_dim( + t_time_sk int, + t_time_id text, + t_time int, + t_hour int, + t_minute int, + t_second int, + t_am_pm text, + t_shift text, + t_sub_shift text, + t_meal_time text); + +CREATE TABLE IF NOT EXISTS warehouse( + w_warehouse_sk int, + w_warehouse_id text, + w_warehouse_name text, + w_warehouse_sq_ft int, + w_street_number text, + w_street_name text, + w_street_type text, + w_suite_number text, + w_city text, + w_county text, + w_state text, + w_zip text, + w_country text, + w_gmt_offset numeric(5,2)); + +CREATE TABLE IF NOT EXISTS web_page( + wp_web_page_sk int, + wp_web_page_id text, + wp_rec_start_date text, + wp_rec_end_date text, + wp_creation_date_sk int, + wp_access_date_sk int, + wp_autogen_flag text, + wp_customer_sk int, + wp_url text, + wp_type text, + wp_char_count int, + wp_link_count int, + wp_image_count int, + wp_max_ad_count int); + +CREATE TABLE IF NOT EXISTS web_returns( + wr_returned_date_sk int, + wr_returned_time_sk int, + wr_item_sk bigint, + wr_refunded_customer_sk int, + wr_refunded_cdemo_sk int, + wr_refunded_hdemo_sk int, + wr_refunded_addr_sk int, + wr_returning_customer_sk int, + wr_returning_cdemo_sk int, + wr_returning_hdemo_sk int, + wr_returning_addr_sk int, + wr_web_page_sk int, + wr_reason_sk int, + wr_order_number bigint, + wr_return_quantity int, + wr_return_amt numeric(7,2), + wr_return_tax numeric(7,2), + wr_return_amt_inc_tax numeric(7,2), + wr_fee numeric(7,2), + wr_return_ship_cost numeric(7,2), + wr_refunded_cash numeric(7,2), + wr_reversed_charge numeric(7,2), + wr_account_credit numeric(7,2), + wr_net_loss numeric(7,2)); + +CREATE TABLE IF NOT EXISTS web_sales( + ws_sold_date_sk int, + ws_sold_time_sk int, + ws_ship_date_sk int, + ws_item_sk bigint, + ws_bill_customer_sk int, + ws_bill_cdemo_sk int, + ws_bill_hdemo_sk int, + ws_bill_addr_sk int, + ws_ship_customer_sk int, + ws_ship_cdemo_sk int, + ws_ship_hdemo_sk int, + ws_ship_addr_sk int, + ws_web_page_sk int, + ws_web_site_sk int, + ws_ship_mode_sk int, + ws_warehouse_sk int, + ws_promo_sk int, + ws_order_number bigint, + ws_quantity int, + ws_wholesale_cost numeric(7,2), + ws_list_price numeric(7,2), + ws_sales_price numeric(7,2), + ws_ext_discount_amt numeric(7,2), + ws_ext_sales_price numeric(7,2), + ws_ext_wholesale_cost numeric(7,2), + ws_ext_list_price numeric(7,2), + ws_ext_tax numeric(7,2), + ws_coupon_amt numeric(7,2), + ws_ext_ship_cost numeric(7,2), + ws_net_paid numeric(7,2), + ws_net_paid_inc_tax numeric(7,2), + ws_net_paid_inc_ship numeric(7,2), + ws_net_paid_inc_ship_tax numeric(7,2), + ws_net_profit numeric(7,2)); + +CREATE TABLE IF NOT EXISTS web_site( + web_site_sk int, + web_site_id text, + web_rec_start_date text, + web_rec_end_date text, + web_name text, + web_open_date_sk int, + web_close_date_sk int, + web_class text, + web_manager text, + web_mkt_id int, + web_mkt_class text, + web_mkt_desc text, + web_market_manager text, + web_company_id int, + web_company_name text, + web_street_number text, + web_street_name text, + web_street_type text, + web_suite_number text, + web_city text, + web_county text, + web_state text, + web_zip text, + web_country text, + web_gmt_offset numeric(5,2), + web_tax_percentage numeric(5,2)); diff --git a/itests/qtest/src/test/java/org/apache/hadoop/hive/cli/TestMiniLlapLocalPostgresJdbcCliDriver.java b/itests/qtest/src/test/java/org/apache/hadoop/hive/cli/TestMiniLlapLocalPostgresJdbcCliDriver.java new file mode 100644 index 000000000000..6e7be3437a5a --- /dev/null +++ b/itests/qtest/src/test/java/org/apache/hadoop/hive/cli/TestMiniLlapLocalPostgresJdbcCliDriver.java @@ -0,0 +1,60 @@ +/* + * 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.hadoop.hive.cli; + +import java.io.File; +import java.util.List; + +import org.apache.hadoop.hive.cli.control.CliAdapter; +import org.apache.hadoop.hive.cli.control.CliConfigs; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestRule; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +@RunWith(Parameterized.class) +public class TestMiniLlapLocalPostgresJdbcCliDriver { + static CliAdapter adapter = new CliConfigs.MiniLlapLocalPostgresJdbcCliConfig().getCliAdapter(); + + @Parameters(name = "{0}") + public static List getParameters() throws Exception { + return adapter.getParameters(); + } + + @ClassRule + public static TestRule cliClassRule = adapter.buildClassRule(); + + @Rule + public TestRule cliTestRule = adapter.buildTestRule(); + + private String name; + private File qfile; + + public TestMiniLlapLocalPostgresJdbcCliDriver(String name, File qfile) { + this.name = name; + this.qfile = qfile; + } + + @Test + public void testCliDriver() throws Exception { + adapter.runTest(name, qfile); + } +} diff --git a/itests/src/test/resources/testconfiguration.properties b/itests/src/test/resources/testconfiguration.properties index 8bfda2ea2af2..6ba77f781bfd 100644 --- a/itests/src/test/resources/testconfiguration.properties +++ b/itests/src/test/resources/testconfiguration.properties @@ -382,6 +382,15 @@ tez.perf.disabled.query.files=\ mv_query67.q,\ mv_query68.q +jdbc.disabled.query.files=\ + cbo_query48.q,\ + mv_query30.q,\ + mv_query44.q,\ + mv_query45.q,\ + mv_query67.q,\ + mv_query68.q,\ + query48.q + hive.kafka.query.files=\ kafka_storage_handler.q diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CliConfigs.java b/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CliConfigs.java index 2850947e7b48..f914955e6606 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CliConfigs.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CliConfigs.java @@ -29,6 +29,7 @@ import org.apache.hadoop.hive.ql.QTestMiniClusters.MiniClusterType; import org.apache.hadoop.hive.ql.hooks.ExplainFormattedCBOHook; import org.apache.hadoop.hive.ql.parse.CoreParseNegative; +import org.apache.hadoop.hive.ql.qoption.QTestDatabaseHandler; public class CliConfigs { @@ -201,7 +202,46 @@ public MiniLlapLocalCliConfig() { } } } - + + public static class MiniLlapLocalPostgresJdbcCliConfig extends AbstractCliConfig implements JdbcCliConfig { + private final QTestDatabaseHandler.DatabaseType databaseType; + private final String jdbcInitScript; + private final String externalTablesInitScript; + + public MiniLlapLocalPostgresJdbcCliConfig() { + super(CoreJdbcCliDriver.class); + try { + databaseType = QTestDatabaseHandler.DatabaseType.POSTGRES; + jdbcInitScript = "q_test_tpcds_schema.postgres.sql"; + externalTablesInitScript = "q_test_tpcds_external_tables_schema.postgres.sql"; + + setQueryDir("ql/src/test/queries/clientpositive/perf"); + setLogDir("itests/qtest/target/qfile-results/clientpositive/jdbc/postgres"); + setResultsDir("ql/src/test/results/clientpositive/jdbc/postgres"); + setHiveConfDir("data/conf/jdbc"); + setClusterType(MiniClusterType.LLAP_LOCAL); + excludesFrom(testConfigProps, "jdbc.disabled.query.files"); + } catch (Exception e) { + throw new RuntimeException("can't construct cliconfig", e); + } + } + + @Override + public QTestDatabaseHandler.DatabaseType getDatabaseType() { + return databaseType; + } + + @Override + public String getJdbcInitScript() { + return jdbcInitScript; + } + + @Override + public String getExternalTablesInitScript() { + return externalTablesInitScript; + } + } + public static class MiniLlapLocalCompactorCliConfig extends AbstractCliConfig { public MiniLlapLocalCompactorCliConfig() { @@ -341,7 +381,7 @@ public TPCDSFormattedCBOConfig() { } } } - + public static class NegativeLlapLocalCliConfig extends AbstractCliConfig { public NegativeLlapLocalCliConfig() { super(CoreNegativeCliDriver.class); diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CoreJdbcCliDriver.java b/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CoreJdbcCliDriver.java new file mode 100644 index 000000000000..b5e48030e812 --- /dev/null +++ b/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CoreJdbcCliDriver.java @@ -0,0 +1,100 @@ +/* + * 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.hadoop.hive.cli.control; + +import org.apache.commons.io.FileUtils; +import org.apache.hadoop.hive.ql.externalDB.AbstractExternalDB; +import org.apache.hadoop.hive.ql.QTestUtil; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +public class CoreJdbcCliDriver extends CoreCliDriver { + private AbstractExternalDB externalDB; + private static final Logger LOG = LoggerFactory.getLogger(CoreJdbcCliDriver.class); + private boolean externalTablesCreated = false; + + public CoreJdbcCliDriver(AbstractCliConfig testCliConfig) { + super(testCliConfig); + } + + @Override + @BeforeClass + public void beforeClass() throws Exception { + super.beforeClass(); + + if (cliConfig instanceof JdbcCliConfig jc) { + LOG.info("Launching docker container, running jdbc init script..."); + Path scriptFile = Paths.get( + QTestUtil.getScriptsDir(getQt().getConf()) + File.separator + jc.getJdbcInitScript() + ); + if (Files.notExists(scriptFile)) { + LOG.info("No jdbc init script detected. Skipping"); + return; + } + externalDB = getQt().getDatabaseHandler().initDb(jc.getDatabaseType(), scriptFile); + } + } + + @Override + @Before + public void setUp() throws Exception { + super.setUp(); + if (!externalTablesCreated && cliConfig instanceof JdbcCliConfig jc) { + LOG.info("Running init script for external tables..."); + File scriptFile = new File( + QTestUtil.getScriptsDir(getQt().getConf()) + File.separator + + jc.getExternalTablesInitScript() + ); + if (!scriptFile.isFile()) { + LOG.info("No init script for external tables detected. Skipping"); + return; + } + String initCommands = FileUtils.readFileToString(scriptFile, StandardCharsets.UTF_8); + getQt().getCliDriver().processLine(initCommands); + externalTablesCreated = true; + } + } + + @Override + @After + public void tearDown() throws Exception { + // Skip clearTestSideEffects() — external tables must persist across tests in the suite. + getQt().clearPostTestEffects(); + } + + @Override + @AfterClass + public void shutdown() throws Exception { + LOG.info("Cleaning up..."); + if (externalDB != null) { + LOG.info("Cleaning up docker..."); + externalDB.stop(); + } + super.shutdown(); + } +} diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/JdbcCliConfig.java b/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/JdbcCliConfig.java new file mode 100644 index 000000000000..20512a3fafcc --- /dev/null +++ b/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/JdbcCliConfig.java @@ -0,0 +1,29 @@ +/* + * 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.hadoop.hive.cli.control; + +import org.apache.hadoop.hive.ql.qoption.QTestDatabaseHandler; + +public interface JdbcCliConfig { + + QTestDatabaseHandler.DatabaseType getDatabaseType(); + + String getJdbcInitScript(); + + String getExternalTablesInitScript(); +} diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java index 4406c5199df6..12dc346d2395 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java @@ -299,6 +299,10 @@ public static String getScriptsDir(HiveConf conf) { return scriptsDir; } + public QTestDatabaseHandler getDatabaseHandler() { + return (QTestDatabaseHandler) dispatcher.getHandler("database"); + } + public void shutdown() throws Exception { if (System.getenv(QTEST_LEAVE_FILES) == null) { cleanUp(); diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/qoption/QTestDatabaseHandler.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/qoption/QTestDatabaseHandler.java index 0bd33cff43ae..e080fb8fa09f 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/qoption/QTestDatabaseHandler.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/qoption/QTestDatabaseHandler.java @@ -28,6 +28,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; @@ -50,40 +51,40 @@ public class QTestDatabaseHandler implements QTestOptionHandler { private static final Logger LOG = LoggerFactory.getLogger(QTestDatabaseHandler.class); - private enum DatabaseType { + public enum DatabaseType { POSTGRES { @Override - AbstractExternalDB create() { + public AbstractExternalDB create() { return new PostgresExternalDB(); } }, MYSQL { @Override - AbstractExternalDB create() { + public AbstractExternalDB create() { return new MySQLExternalDB(); } }, MARIADB { @Override - AbstractExternalDB create() { + public AbstractExternalDB create() { return new MariaDB(); } }, MSSQL { @Override - AbstractExternalDB create() { + public AbstractExternalDB create() { return new MSSQLServer(); } }, ORACLE { @Override - AbstractExternalDB create() { + public AbstractExternalDB create() { return new Oracle(); } }, DERBY { @Override - AbstractExternalDB create() { + public AbstractExternalDB create() { return new Derby(); } }; - abstract AbstractExternalDB create(); + public abstract AbstractExternalDB create(); } private final String scriptsDir; @@ -93,6 +94,24 @@ public QTestDatabaseHandler(final String scriptDirectory) { this.scriptsDir = scriptDirectory; } + public AbstractExternalDB initDb(String dbType, Path initScript) throws Exception { + return initDb(DatabaseType.valueOf(dbType.toUpperCase()), "qtestDB", initScript); + } + + public AbstractExternalDB initDb(DatabaseType dbType, Path initScript) throws Exception { + return initDb(dbType, "qtestDB", initScript); + } + + public AbstractExternalDB initDb(DatabaseType dbType, String dbName, Path initScript) throws Exception { + AbstractExternalDB db = dbType.create(); + db.setName(dbName); + if (initScript != null) { + db.setInitScript(initScript); + } + db.start(); + return db; + } + @Override public void processArguments(String arguments) { String[] args = arguments.split(":"); diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/qoption/QTestOptionDispatcher.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/qoption/QTestOptionDispatcher.java index 75939a46382f..b5aee459b4ba 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/qoption/QTestOptionDispatcher.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/qoption/QTestOptionDispatcher.java @@ -47,6 +47,10 @@ public void register(String prefix, QTestOptionHandler datasetHandler) { handlers.put(prefix, datasetHandler); } + public QTestOptionHandler getHandler(String prefix) { + return handlers.get(prefix); + } + public void process(File file) { synchronized (QTestUtil.class) { parse(file); diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_ext_query1.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_ext_query1.q.out new file mode 100644 index 000000000000..17951803da63 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_ext_query1.q.out @@ -0,0 +1,86 @@ +CBO PLAN: +HiveProject(c_customer_id=[$0]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + HiveProject(c_customer_id=[$0]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + HiveJdbcConverter(convention=[JDBC.POSTGRES]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcSort(sort0=[$0], dir0=[ASC], fetch=[100]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(c_customer_id=[$5]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcJoin(condition=[AND(=($1, $7), >($2, $6))], joinType=[inner]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcJoin(condition=[=($0, $4)], joinType=[inner]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcJoin(condition=[=($3, $1)], joinType=[inner]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(sr_customer_sk=[$0], sr_store_sk=[$1], $f2=[$2]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[IS NOT NULL($2)]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcAggregate(group=[{1, 2}], agg#0=[sum($3)]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcJoin(condition=[=($0, $4)], joinType=[inner]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(sr_returned_date_sk=[$0], sr_customer_sk=[$1], sr_store_sk=[$2], sr_fee=[$3]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(sr_returned_date_sk=[$0], sr_customer_sk=[$3], sr_store_sk=[$7], sr_fee=[$14]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(d_date_sk=[$0]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(d_date_sk=[$0], d_year=[$6]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(s_store_sk=[$0]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[AND(=($1, _UTF-16LE'NM'), IS NOT NULL($0))]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(s_store_sk=[$0], s_state=[$24]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[IS NOT NULL($0)]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(_o__c0=[*(CAST(/($1, $2)):DECIMAL(21, 6), 1.2:DECIMAL(2, 1))], ctr_store_sk=[$0]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[IS NOT NULL(CAST(/($1, $2)):DECIMAL(21, 6))]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcAggregate(group=[{1}], agg#0=[sum($2)], agg#1=[count($2)]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcAggregate(group=[{1, 2}], agg#0=[sum($3)]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcJoin(condition=[=($0, $4)], joinType=[inner]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(sr_returned_date_sk=[$0], sr_customer_sk=[$1], sr_store_sk=[$2], sr_fee=[$3]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2))]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(sr_returned_date_sk=[$0], sr_customer_sk=[$3], sr_store_sk=[$7], sr_fee=[$14]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(d_date_sk=[$0]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(d_date_sk=[$0], d_year=[$6]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + +CBO PLAN: +HiveProject(c_customer_id=[$0]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + HiveProject(c_customer_id=[$0]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + HiveJdbcConverter(convention=[JDBC.POSTGRES]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcSort(sort0=[$0], dir0=[ASC], fetch=[100]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(c_customer_id=[$5]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcJoin(condition=[AND(=($1, $7), >($2, $6))], joinType=[inner]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcJoin(condition=[=($0, $4)], joinType=[inner]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcJoin(condition=[=($3, $1)], joinType=[inner]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(sr_customer_sk=[$0], sr_store_sk=[$1], $f2=[$2]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[IS NOT NULL($2)]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcAggregate(group=[{1, 2}], agg#0=[sum($3)]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcJoin(condition=[=($0, $4)], joinType=[inner]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(sr_returned_date_sk=[$0], sr_customer_sk=[$1], sr_store_sk=[$2], sr_fee=[$3]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(sr_returned_date_sk=[$0], sr_customer_sk=[$3], sr_store_sk=[$7], sr_fee=[$14]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(d_date_sk=[$0]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(d_date_sk=[$0], d_year=[$6]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(s_store_sk=[$0]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[AND(=($1, _UTF-16LE'NM'), IS NOT NULL($0))]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(s_store_sk=[$0], s_state=[$24]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[IS NOT NULL($0)]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(_o__c0=[*(CAST(/($1, $2)):DECIMAL(21, 6), 1.2:DECIMAL(2, 1))], ctr_store_sk=[$0]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[IS NOT NULL(CAST(/($1, $2)):DECIMAL(21, 6))]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcAggregate(group=[{1}], agg#0=[sum($2)], agg#1=[count($2)]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcAggregate(group=[{1, 2}], agg#0=[sum($3)]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcJoin(condition=[=($0, $4)], joinType=[inner]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(sr_returned_date_sk=[$0], sr_customer_sk=[$1], sr_store_sk=[$2], sr_fee=[$3]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2))]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(sr_returned_date_sk=[$0], sr_customer_sk=[$3], sr_store_sk=[$7], sr_fee=[$14]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(d_date_sk=[$0]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcProject(d_date_sk=[$0], d_year=[$6]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]): rowcount = ###Masked###, cumulative cost = ###Masked###, id = ###Masked### + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query1.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query1.q.out new file mode 100644 index 000000000000..bc921ad7c1fd --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query1.q.out @@ -0,0 +1,43 @@ +CBO PLAN: +HiveProject(c_customer_id=[$0]) + HiveProject(c_customer_id=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], dir0=[ASC], fetch=[100]) + JdbcProject(c_customer_id=[$5]) + JdbcJoin(condition=[AND(=($1, $7), >($2, $6))], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($3, $1)], joinType=[inner]) + JdbcProject(sr_customer_sk=[$0], sr_store_sk=[$1], $f2=[$2]) + JdbcFilter(condition=[IS NOT NULL($2)]) + JdbcAggregate(group=[{1, 2}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(sr_returned_date_sk=[$0], sr_customer_sk=[$1], sr_store_sk=[$2], sr_fee=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(sr_returned_date_sk=[$0], sr_customer_sk=[$3], sr_store_sk=[$7], sr_fee=[$14]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'NM'), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_state=[$24]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(_o__c0=[*(CAST(/($1, $2)):DECIMAL(21, 6), 1.2:DECIMAL(2, 1))], ctr_store_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL(CAST(/($1, $2)):DECIMAL(21, 6))]) + JdbcAggregate(group=[{1}], agg#0=[sum($2)], agg#1=[count($2)]) + JdbcAggregate(group=[{1, 2}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(sr_returned_date_sk=[$0], sr_customer_sk=[$1], sr_store_sk=[$2], sr_fee=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(sr_returned_date_sk=[$0], sr_customer_sk=[$3], sr_store_sk=[$7], sr_fee=[$14]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query10.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query10.q.out new file mode 100644 index 000000000000..a7ef4f3add16 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query10.q.out @@ -0,0 +1,62 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$4], sort4=[$6], sort5=[$8], sort6=[$10], sort7=[$12], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], dir5=[ASC], dir6=[ASC], dir7=[ASC], fetch=[100]) + HiveProject(cd_gender=[$0], cd_marital_status=[$1], cd_education_status=[$2], cnt1=[$8], cd_purchase_estimate=[$3], cnt2=[$8], cd_credit_rating=[$4], cnt3=[$8], cd_dep_count=[$5], cnt4=[$8], cd_dep_employed_count=[$6], cnt5=[$8], cd_dep_college_count=[$7], cnt6=[$8]) + HiveAggregate(group=[{6, 7, 8, 9, 10, 11, 12, 13}], agg#0=[count()]) + HiveFilter(condition=[OR(IS NOT NULL($14), IS NOT NULL($16))]) + HiveJoin(condition=[=($0, $17)], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($0, $15)], joinType=[left], algorithm=[none], cost=[not available]) + HiveSemiJoin(condition=[=($0, $14)], joinType=[semi]) + HiveProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_addr_sk=[$2], ca_address_sk=[$3], ca_county=[$4], cd_demo_sk=[$5], cd_gender=[$6], cd_marital_status=[$7], cd_education_status=[$8], cd_purchase_estimate=[$9], cd_credit_rating=[$10], cd_dep_count=[$11], cd_dep_employed_count=[$12], cd_dep_college_count=[$13]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($5, $1)], joinType=[inner]) + JdbcJoin(condition=[=($2, $3)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_addr_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$2], c_current_addr_sk=[$4]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[c]) + JdbcProject(ca_address_sk=[$0], ca_county=[$1]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'Dona Ana County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Douglas County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Gaines County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Richland County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Walker County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_county=[$7]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[ca]) + JdbcProject(cd_demo_sk=[$0], cd_gender=[$1], cd_marital_status=[$2], cd_education_status=[$3], cd_purchase_estimate=[$4], cd_credit_rating=[$5], cd_dep_count=[$6], cd_dep_employed_count=[$7], cd_dep_college_count=[$8]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[customer_demographics]) + HiveProject(ss_customer_sk=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ss_customer_sk=[$1]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2002), BETWEEN(false, $2, 4, 7), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(literalTrue=[$0], ws_bill_customer_sk=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(literalTrue=[true], ws_bill_customer_sk=[$0]) + JdbcAggregate(group=[{1}]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$4]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2002), BETWEEN(false, $2, 4, 7), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(literalTrue=[$0], cs_ship_customer_sk=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(literalTrue=[true], cs_ship_customer_sk=[$0]) + JdbcAggregate(group=[{1}]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_ship_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_ship_customer_sk=[$7]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2002), BETWEEN(false, $2, 4, 7), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query11.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query11.q.out new file mode 100644 index 000000000000..98326cac261f --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query11.q.out @@ -0,0 +1,76 @@ +CBO PLAN: +HiveProject(t_s_secyear.customer_id=[$0], t_s_secyear.customer_first_name=[$1], t_s_secyear.customer_last_name=[$2], t_s_secyear.customer_birth_country=[$3]) + HiveProject(customer_id=[$0], customer_first_name=[$1], customer_last_name=[$2], customer_birth_country=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], fetch=[100]) + JdbcProject(customer_id=[$8], customer_first_name=[$9], customer_last_name=[$10], customer_birth_country=[$11]) + JdbcJoin(condition=[AND(=($8, $0), CASE($2, CASE($7, >(/($4, $6), /($12, $1)), >(0:DECIMAL(1, 0), /($12, $1))), CASE($7, >(/($4, $6), 0:DECIMAL(1, 0)), false)))], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(customer_id=[$0], year_total=[$7], EXPR$0=[>($7, 0:DECIMAL(1, 0))]) + JdbcFilter(condition=[>($7, 0:DECIMAL(1, 0))]) + JdbcAggregate(group=[{1, 2, 3, 4, 5, 6, 7}], agg#0=[sum($10)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4], c_birth_country=[$5], c_login=[$6], c_email_address=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], $f8=[-($3, $2)]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_ext_discount_amt=[$14], ss_ext_list_price=[$17]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(customer_id=[$0], year_total=[$7]) + JdbcAggregate(group=[{1, 2, 3, 4, 5, 6, 7}], agg#0=[sum($10)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4], c_birth_country=[$5], c_login=[$6], c_email_address=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$1], $f8=[-($3, $2)]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$4], ws_ext_discount_amt=[$22], ws_ext_list_price=[$25]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(customer_id=[$0], year_total=[$7], EXPR$1=[>($7, 0:DECIMAL(1, 0))]) + JdbcFilter(condition=[>($7, 0:DECIMAL(1, 0))]) + JdbcAggregate(group=[{1, 2, 3, 4, 5, 6, 7}], agg#0=[sum($10)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4], c_birth_country=[$5], c_login=[$6], c_email_address=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$1], $f8=[-($3, $2)]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$4], ws_ext_discount_amt=[$22], ws_ext_list_price=[$25]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(customer_id=[$0], customer_first_name=[$1], customer_last_name=[$2], customer_birth_country=[$4], year_total=[$7]) + JdbcAggregate(group=[{1, 2, 3, 4, 5, 6, 7}], agg#0=[sum($10)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4], c_birth_country=[$5], c_login=[$6], c_email_address=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], $f8=[-($3, $2)]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_ext_discount_amt=[$14], ss_ext_list_price=[$17]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query12.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query12.q.out new file mode 100644 index 000000000000..f4cf5577cc31 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query12.q.out @@ -0,0 +1,22 @@ +CBO PLAN: +HiveProject(i_item_desc=[$0], i_category=[$1], i_class=[$2], i_current_price=[$3], itemrevenue=[$4], revenueratio=[$5]) + HiveSortLimit(sort0=[$1], sort1=[$2], sort2=[$6], sort3=[$0], sort4=[$5], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], fetch=[100]) + HiveProject(i_item_desc=[$1], i_category=[$4], i_class=[$3], i_current_price=[$2], itemrevenue=[$5], revenueratio=[/(*($5, 100:DECIMAL(10, 0)), sum($5) OVER (PARTITION BY $3 ORDER BY $3 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING))], (tok_table_or_col i_item_id)=[$0]) + HiveProject(i_item_id=[$0], i_item_desc=[$1], i_current_price=[$2], i_class=[$3], i_category=[$4], $f5=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{5, 6, 7, 8, 9}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 2001-01-12 00:00:00:TIMESTAMP(9), 2001-02-11 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$2], i_current_price=[$3], i_class=[$4], i_category=[$5]) + JdbcFilter(condition=[AND(IN($5, _UTF-16LE'Books':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Jewelry':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Sports':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$4], i_current_price=[$5], i_class=[$10], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query13.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query13.q.out new file mode 100644 index 000000000000..7f7e010ca438 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query13.q.out @@ -0,0 +1,36 @@ +CBO PLAN: +HiveProject(_c0=[$0], _c1=[$1], _c2=[$2], _c3=[$3]) + HiveProject(_o__c0=[$0], _o__c1=[$1], _o__c2=[$2], _o__c3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(_o__c0=[/(CAST($0):DOUBLE, $1)], _o__c1=[CAST(/($2, $3)):DECIMAL(11, 6)], _o__c2=[CAST(/($4, $5)):DECIMAL(11, 6)], _o__c3=[$4]) + JdbcAggregate(group=[{}], agg#0=[sum($5)], agg#1=[count($5)], agg#2=[sum($6)], agg#3=[count($6)], agg#4=[sum($7)], agg#5=[count($7)]) + JdbcJoin(condition=[AND(=($23, $1), OR(AND($24, $25, $11, $17), AND($26, $27, $12, $18), AND($28, $29, $13, $18)))], joinType=[inner]) + JdbcJoin(condition=[AND(=($3, $19), OR(AND($20, $8), AND($21, $9), AND($22, $10)))], joinType=[inner]) + JdbcJoin(condition=[=($2, $16)], joinType=[inner]) + JdbcJoin(condition=[=($0, $15)], joinType=[inner]) + JdbcJoin(condition=[=($14, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_cdemo_sk=[$1], ss_hdemo_sk=[$2], ss_addr_sk=[$3], ss_store_sk=[$4], ss_quantity=[$5], ss_ext_sales_price=[$7], ss_ext_wholesale_cost=[$8], EXPR$0=[BETWEEN(false, $9, 100:DECIMAL(12, 2), 200:DECIMAL(12, 2))], EXPR$1=[BETWEEN(false, $9, 150:DECIMAL(12, 2), 300:DECIMAL(12, 2))], EXPR$2=[BETWEEN(false, $9, 50:DECIMAL(12, 2), 250:DECIMAL(12, 2))], EXPR$5=[BETWEEN(false, $6, 100:DECIMAL(3, 0), 150:DECIMAL(3, 0))], EXPR$8=[BETWEEN(false, $6, 50:DECIMAL(3, 0), 100:DECIMAL(3, 0))], EXPR$11=[BETWEEN(false, $6, 150:DECIMAL(3, 0), 200:DECIMAL(3, 0))]) + JdbcFilter(condition=[AND(IS NOT NULL($6), IS NOT NULL($9), IS NOT NULL($4), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_cdemo_sk=[$4], ss_hdemo_sk=[$5], ss_addr_sk=[$6], ss_store_sk=[$7], ss_quantity=[$10], ss_sales_price=[$13], ss_ext_sales_price=[$15], ss_ext_wholesale_cost=[$16], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(hd_demo_sk=[$0], EXPR$0=[=($1, 3)], EXPR$1=[=($1, 1)]) + JdbcFilter(condition=[AND(IN($1, 1, 3), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(ca_address_sk=[$0], EXPR$0=[IN($1, _UTF-16LE'GA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'KY':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'NM':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")], EXPR$1=[IN($1, _UTF-16LE'IN':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MT':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'OR':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")], EXPR$2=[IN($1, _UTF-16LE'MO':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'WI':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'WV':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'GA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'IN':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'KY':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MO':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MT':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'NM':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'OR':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'WI':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'WV':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), =($2, _UTF-16LE'United States'), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8], ca_country=[$10]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(cd_demo_sk=[$0], EXPR$3=[=($1, _UTF-16LE'M')], EXPR$4=[=($2, _UTF-16LE'4 yr Degree')], EXPR$6=[=($1, _UTF-16LE'D')], EXPR$7=[=($2, _UTF-16LE'Primary')], EXPR$9=[=($1, _UTF-16LE'U')], EXPR$10=[=($2, _UTF-16LE'Advanced Degree')]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'D':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'M':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'U':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'4 yr Degree':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Advanced Degree':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Primary':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$2], cd_education_status=[$3]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[customer_demographics]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query14.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query14.q.out new file mode 100644 index 000000000000..1bf14f997970 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query14.q.out @@ -0,0 +1,332 @@ +Warning: Shuffle Join MERGEJOIN[334][tables = [$hdt$_1, $hdt$_2]] in Stage 'Reducer 28' is a cross product +Warning: Shuffle Join MERGEJOIN[340][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 'Reducer 9' is a cross product +Warning: Shuffle Join MERGEJOIN[346][tables = [$hdt$_2, $hdt$_3, $hdt$_1]] in Stage 'Reducer 17' is a cross product +Warning: Shuffle Join MERGEJOIN[352][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 'Reducer 20' is a cross product +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], fetch=[100]) + HiveProject(channel=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3], _c4=[$4], _c5=[$5]) + HiveAggregate(group=[{0, 1, 2, 3}], groups=[[{0, 1, 2, 3}, {0, 1, 2}, {0, 1}, {0}, {}]], agg#0=[sum($4)], agg#1=[sum($5)]) + HiveProject(channel=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3], sales=[$4], number_sales=[$5]) + HiveUnion(all=[true]) + HiveProject(channel=[_UTF-16LE'store':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], sales=[$3], number_sales=[$4]) + HiveJoin(condition=[>($3, $6)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + HiveFilter(condition=[IS NOT NULL($3)]) + HiveAggregate(group=[{0, 1, 2}], agg#0=[sum($3)], agg#1=[count()]) + HiveProject($f0=[$5], $f1=[$6], $f2=[$7], $f3=[*(CAST($2):DECIMAL(10, 0), $3)]) + HiveSemiJoin(condition=[=($1, $11)], joinType=[semi]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_quantity=[$2], ss_list_price=[$3], i_item_sk=[$4], i_brand_id=[$5], i_class_id=[$6], i_category_id=[$7], d_date_sk=[$8], d_year=[$9], d_moy=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_quantity=[$2], ss_list_price=[$3], i_item_sk=[$7], i_brand_id=[$8], i_class_id=[$9], i_category_id=[$10], d_date_sk=[$4], d_year=[$5], d_moy=[$6]) + JdbcJoin(condition=[=($1, $7)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_quantity=[$2], ss_list_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_quantity=[$10], ss_list_price=[$12]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 2000), =($2, 11), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(i_item_sk=[$0]) + HiveJoin(condition=[AND(=($1, $4), =($2, $5), =($3, $6))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + HiveProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + HiveProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2]) + HiveFilter(condition=[=($3, 3)]) + HiveAggregate(group=[{0, 1, 2}], agg#0=[count($3)]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveUnion(all=[true]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{4, 5, 6}], agg#0=[count()]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1999, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[iss]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{4, 5, 6}], agg#0=[count()]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$15]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1999, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d2]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[ics]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{4, 5, 6}], agg#0=[count()]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1999, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d3]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[iws]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(cnt=[$0]) + HiveFilter(condition=[sq_count_check($0)]) + HiveProject(cnt=[$0]) + HiveAggregate(group=[{}], cnt=[COUNT()]) + HiveTableScan(table=[[default, avg_sales]], table:alias=[avg_sales]) + HiveProject(average_sales=[$0]) + HiveFilter(condition=[IS NOT NULL($0)]) + HiveTableScan(table=[[default, avg_sales]], table:alias=[avg_sales]) + HiveProject(channel=[_UTF-16LE'catalog':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], sales=[$3], number_sales=[$4]) + HiveJoin(condition=[>($3, $6)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + HiveFilter(condition=[IS NOT NULL($3)]) + HiveAggregate(group=[{0, 1, 2}], agg#0=[sum($3)], agg#1=[count()]) + HiveProject($f0=[$5], $f1=[$6], $f2=[$7], $f3=[*(CAST($2):DECIMAL(10, 0), $3)]) + HiveSemiJoin(condition=[=($1, $11)], joinType=[semi]) + HiveProject(cs_sold_date_sk=[$0], cs_item_sk=[$1], cs_quantity=[$2], cs_list_price=[$3], i_item_sk=[$4], i_brand_id=[$5], i_class_id=[$6], i_category_id=[$7], d_date_sk=[$8], d_year=[$9], d_moy=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$1], cs_quantity=[$2], cs_list_price=[$3], i_item_sk=[$7], i_brand_id=[$8], i_class_id=[$9], i_category_id=[$10], d_date_sk=[$4], d_year=[$5], d_moy=[$6]) + JdbcJoin(condition=[=($1, $7)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$1], cs_quantity=[$2], cs_list_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$15], cs_quantity=[$18], cs_list_price=[$20]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 2000), =($2, 11), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(i_item_sk=[$0]) + HiveJoin(condition=[AND(=($1, $4), =($2, $5), =($3, $6))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + HiveProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + HiveProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2]) + HiveFilter(condition=[=($3, 3)]) + HiveAggregate(group=[{0, 1, 2}], agg#0=[count($3)]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveUnion(all=[true]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{4, 5, 6}], agg#0=[count()]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1999, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[iss]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{4, 5, 6}], agg#0=[count()]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$15]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1999, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d2]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[ics]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{4, 5, 6}], agg#0=[count()]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1999, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d3]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[iws]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(cnt=[$0]) + HiveFilter(condition=[sq_count_check($0)]) + HiveProject(cnt=[$0]) + HiveAggregate(group=[{}], cnt=[COUNT()]) + HiveTableScan(table=[[default, avg_sales]], table:alias=[avg_sales]) + HiveProject(average_sales=[$0]) + HiveFilter(condition=[IS NOT NULL($0)]) + HiveTableScan(table=[[default, avg_sales]], table:alias=[avg_sales]) + HiveProject(channel=[_UTF-16LE'web':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], sales=[$3], number_sales=[$4]) + HiveJoin(condition=[>($3, $6)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + HiveFilter(condition=[IS NOT NULL($3)]) + HiveAggregate(group=[{0, 1, 2}], agg#0=[sum($3)], agg#1=[count()]) + HiveProject($f0=[$5], $f1=[$6], $f2=[$7], $f3=[*(CAST($2):DECIMAL(10, 0), $3)]) + HiveSemiJoin(condition=[=($1, $11)], joinType=[semi]) + HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_quantity=[$2], ws_list_price=[$3], i_item_sk=[$4], i_brand_id=[$5], i_class_id=[$6], i_category_id=[$7], d_date_sk=[$8], d_year=[$9], d_moy=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_quantity=[$2], ws_list_price=[$3], i_item_sk=[$7], i_brand_id=[$8], i_class_id=[$9], i_category_id=[$10], d_date_sk=[$4], d_year=[$5], d_moy=[$6]) + JdbcJoin(condition=[=($1, $7)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_quantity=[$2], ws_list_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_quantity=[$18], ws_list_price=[$20]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 2000), =($2, 11), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(i_item_sk=[$0]) + HiveJoin(condition=[AND(=($1, $4), =($2, $5), =($3, $6))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + HiveProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + HiveProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2]) + HiveFilter(condition=[=($3, 3)]) + HiveAggregate(group=[{0, 1, 2}], agg#0=[count($3)]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveUnion(all=[true]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{4, 5, 6}], agg#0=[count()]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1999, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[iss]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{4, 5, 6}], agg#0=[count()]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$15]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1999, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d2]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[ics]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{4, 5, 6}], agg#0=[count()]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1999, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d3]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[iws]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(cnt=[$0]) + HiveFilter(condition=[sq_count_check($0)]) + HiveProject(cnt=[$0]) + HiveAggregate(group=[{}], cnt=[COUNT()]) + HiveTableScan(table=[[default, avg_sales]], table:alias=[avg_sales]) + HiveProject(average_sales=[$0]) + HiveFilter(condition=[IS NOT NULL($0)]) + HiveTableScan(table=[[default, avg_sales]], table:alias=[avg_sales]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query15.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query15.q.out new file mode 100644 index 000000000000..a318eb2afaba --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query15.q.out @@ -0,0 +1,29 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], dir0=[ASC], fetch=[100]) + HiveProject(ca_zip=[$0], _c1=[$1]) + HiveAggregate(group=[{1}], agg#0=[sum($8)]) + HiveJoin(condition=[AND(=($7, $4), OR($2, $9, $3))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($5, $0)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ca_address_sk=[$0], ca_zip=[$2], EXPR$0=[IN($1, _UTF-16LE'CA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'GA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'WA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")], EXPR$1=[IN(substr($2, 1, 5), _UTF-16LE'85669':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'86197':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'88274':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'83405':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'86475':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'85392':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'85460':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'80348':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'81792':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")]) + HiveProject(ca_address_sk=[$0], ca_state=[$1], ca_zip=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8], ca_zip=[$9]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + HiveProject(c_customer_sk=[$0], c_current_addr_sk=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$4]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + HiveProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_sales_price=[$2], EXPR$0=[$3], d_date_sk=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_sales_price=[$2], EXPR$0=[>($2, 500:DECIMAL(3, 0))]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], cs_sales_price=[$21]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 2), =($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query16.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query16.q.out new file mode 100644 index 000000000000..0aaa3728d465 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query16.q.out @@ -0,0 +1,38 @@ +CBO PLAN: +HiveProject(order count=[$0], total shipping cost=[$1], total net profit=[$2]) + HiveAggregate(group=[{}], agg#0=[count(DISTINCT $4)], agg#1=[sum($5)], agg#2=[sum($6)]) + HiveAntiJoin(condition=[=($4, $14)], joinType=[anti]) + HiveSemiJoin(condition=[AND(=($4, $14), <>($3, $13))], joinType=[semi]) + HiveProject(cs_ship_date_sk=[$0], cs_ship_addr_sk=[$1], cs_call_center_sk=[$2], cs_warehouse_sk=[$3], cs_order_number=[$4], cs_ext_ship_cost=[$5], cs_net_profit=[$6], d_date_sk=[$7], d_date=[$8], ca_address_sk=[$9], ca_state=[$10], cc_call_center_sk=[$11], cc_county=[$12]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($2, $11)], joinType=[inner]) + JdbcJoin(condition=[=($1, $9)], joinType=[inner]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcProject(cs_ship_date_sk=[$0], cs_ship_addr_sk=[$1], cs_call_center_sk=[$2], cs_warehouse_sk=[$3], cs_order_number=[$4], cs_ext_ship_cost=[$5], cs_net_profit=[$6]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($4))]) + JdbcProject(cs_ship_date_sk=[$2], cs_ship_addr_sk=[$10], cs_call_center_sk=[$11], cs_warehouse_sk=[$14], cs_order_number=[$17], cs_ext_ship_cost=[$28], cs_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[cs1]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 2001-04-01 00:00:00:TIMESTAMP(9), 2001-05-31 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_state=[$1]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'NY'), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(cc_call_center_sk=[$0], cc_county=[$1]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'Daviess County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Franklin Parish':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Huron County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Levy County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Ziebach County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(cc_call_center_sk=[$0], cc_county=[$25]) + JdbcHiveTableScan(table=[[default, call_center]], table:alias=[call_center]) + HiveProject(cs_warehouse_sk=[$0], cs_order_number=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_warehouse_sk=[$14], cs_order_number=[$17]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[cs2]) + HiveProject(literalTrue=[$0], cr_order_number=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(literalTrue=[true], cr_order_number=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cr_order_number=[$16]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[cr1]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query17.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query17.q.out new file mode 100644 index 000000000000..77bda8543090 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query17.q.out @@ -0,0 +1,50 @@ +CBO PLAN: +HiveProject(i_item_id=[$0], i_item_desc=[$1], s_state=[$2], store_sales_quantitycount=[$3], store_sales_quantityave=[$4], store_sales_quantitystdev=[$5], store_sales_quantitycov=[$6], as_store_returns_quantitycount=[$7], as_store_returns_quantityave=[$8], as_store_returns_quantitystdev=[$9], store_returns_quantitycov=[$10], catalog_sales_quantitycount=[$11], catalog_sales_quantityave=[$12], catalog_sales_quantitystdev=[$13], catalog_sales_quantitycov=[$14]) + HiveProject(i_item_id=[$0], i_item_desc=[$1], s_state=[$2], store_sales_quantitycount=[$3], store_sales_quantityave=[$4], store_sales_quantitystdev=[$5], store_sales_quantitycov=[$6], as_store_returns_quantitycount=[$7], as_store_returns_quantityave=[$8], as_store_returns_quantitystdev=[$9], store_returns_quantitycov=[$10], catalog_sales_quantitycount=[$11], catalog_sales_quantityave=[$12], catalog_sales_quantitystdev=[$13], catalog_sales_quantitycov=[$14]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], dir0=[ASC], dir1=[ASC], dir2=[ASC], fetch=[100]) + JdbcProject(i_item_id=[$0], i_item_desc=[$1], s_state=[$2], store_sales_quantitycount=[$3], store_sales_quantityave=[/(CAST($4):DOUBLE, $3)], store_sales_quantitystdev=[POWER(/(-($5, /(*($6, $6), $7)), CASE(=($7, 1), null:BIGINT, -($7, 1))), 0.5:DECIMAL(2, 1))], store_sales_quantitycov=[/(POWER(/(-($5, /(*($6, $6), $7)), CASE(=($7, 1), null:BIGINT, -($7, 1))), 0.5:DECIMAL(2, 1)), /(CAST($4):DOUBLE, $3))], as_store_returns_quantitycount=[$8], as_store_returns_quantityave=[/(CAST($9):DOUBLE, $8)], as_store_returns_quantitystdev=[POWER(/(-($10, /(*($11, $11), $12)), CASE(=($12, 1), null:BIGINT, -($12, 1))), 0.5:DECIMAL(2, 1))], store_returns_quantitycov=[/(POWER(/(-($10, /(*($11, $11), $12)), CASE(=($12, 1), null:BIGINT, -($12, 1))), 0.5:DECIMAL(2, 1)), /(CAST($9):DOUBLE, $8))], catalog_sales_quantitycount=[$13], catalog_sales_quantityave=[/(CAST($14):DOUBLE, $13)], catalog_sales_quantitystdev=[/(POWER(/(-($15, /(*($16, $16), $17)), CASE(=($17, 1), null:BIGINT, -($17, 1))), 0.5:DECIMAL(2, 1)), /(CAST($14):DOUBLE, $13))], catalog_sales_quantitycov=[/(POWER(/(-($15, /(*($16, $16), $17)), CASE(=($17, 1), null:BIGINT, -($17, 1))), 0.5:DECIMAL(2, 1)), /(CAST($14):DOUBLE, $13))]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[count($3)], agg#1=[sum($3)], agg#2=[sum($7)], agg#3=[sum($6)], agg#4=[count($6)], agg#5=[count($4)], agg#6=[sum($4)], agg#7=[sum($9)], agg#8=[sum($8)], agg#9=[count($8)], agg#10=[count($5)], agg#11=[sum($5)], agg#12=[sum($11)], agg#13=[sum($10)], agg#14=[count($10)]) + JdbcProject($f0=[$10], $f1=[$11], $f2=[$8], $f3=[$5], $f4=[$16], $f5=[$21], $f30=[CAST($5):DOUBLE], $f7=[*(CAST($5):DOUBLE, CAST($5):DOUBLE)], $f40=[CAST($16):DOUBLE], $f9=[*(CAST($16):DOUBLE, CAST($16):DOUBLE)], $f50=[CAST($21):DOUBLE], $f11=[*(CAST($21):DOUBLE, CAST($21):DOUBLE)]) + JdbcJoin(condition=[AND(=($2, $14), =($1, $13), =($4, $15))], joinType=[inner]) + JdbcJoin(condition=[=($9, $1)], joinType=[inner]) + JdbcJoin(condition=[=($7, $3)], joinType=[inner]) + JdbcJoin(condition=[=($6, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2], ss_store_sk=[$3], ss_ticket_number=[$4], ss_quantity=[$5]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($4), IS NOT NULL($0), IS NOT NULL($3))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_customer_sk=[$3], ss_store_sk=[$7], ss_ticket_number=[$9], ss_quantity=[$10]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'2000Q1'), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_quarter_name=[$15]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(s_store_sk=[$0], s_state=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0], s_state=[$24]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$4]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$1], sr_customer_sk=[$2], sr_ticket_number=[$3], sr_return_quantity=[$4], d_date_sk=[$5], cs_sold_date_sk=[$6], cs_bill_customer_sk=[$7], cs_item_sk=[$8], cs_quantity=[$9], d_date_sk0=[$10]) + JdbcJoin(condition=[AND(=($2, $7), =($1, $8))], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$1], sr_customer_sk=[$2], sr_ticket_number=[$3], sr_return_quantity=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($3), IS NOT NULL($0))]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$2], sr_customer_sk=[$3], sr_ticket_number=[$9], sr_return_quantity=[$10]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'2000Q1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'2000Q2':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'2000Q3':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_quarter_name=[$15]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d2]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2], cs_quantity=[$3], d_date_sk=[$4]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2], cs_quantity=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], cs_item_sk=[$15], cs_quantity=[$18]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'2000Q1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'2000Q2':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'2000Q3':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_quarter_name=[$15]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d3]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query18.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query18.q.out new file mode 100644 index 000000000000..80e89633a176 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query18.q.out @@ -0,0 +1,42 @@ +CBO PLAN: +HiveSortLimit(sort0=[$1], sort1=[$2], sort2=[$3], sort3=[$0], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], fetch=[100]) + HiveProject(i_item_id=[$0], ca_country=[$3], ca_state=[$2], ca_county=[$1], agg1=[CAST(/($4, $5)):DECIMAL(16, 6)], agg2=[CAST(/($6, $7)):DECIMAL(16, 6)], agg3=[CAST(/($8, $9)):DECIMAL(16, 6)], agg4=[CAST(/($10, $11)):DECIMAL(16, 6)], agg5=[CAST(/($12, $13)):DECIMAL(16, 6)], agg6=[CAST(/($14, $15)):DECIMAL(16, 6)], agg7=[CAST(/($16, $17)):DECIMAL(16, 6)]) + HiveAggregate(group=[{13, 20, 21, 22}], groups=[[{13, 20, 21, 22}, {13, 21, 22}, {13, 22}, {13}, {}]], agg#0=[sum($4)], agg#1=[count($4)], agg#2=[sum($5)], agg#3=[count($5)], agg#4=[sum($6)], agg#5=[count($6)], agg#6=[sum($7)], agg#7=[count($7)], agg#8=[sum($8)], agg#9=[count($8)], agg#10=[sum($17)], agg#11=[count($17)], agg#12=[sum($11)], agg#13=[count($11)]) + HiveProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_bill_cdemo_sk=[$2], cs_item_sk=[$3], $f4=[$4], $f5=[$5], $f6=[$6], $f7=[$7], $f8=[$8], d_date_sk=[$9], cd_demo_sk=[$10], $f10=[$11], i_item_sk=[$12], i_item_id=[$13], c_customer_sk=[$14], c_current_cdemo_sk=[$15], c_current_addr_sk=[$16], $f9=[$17], cd_demo_sk0=[$18], ca_address_sk=[$19], ca_county=[$20], ca_state=[$21], ca_country=[$22]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($1, $14)], joinType=[inner]) + JdbcJoin(condition=[=($3, $12)], joinType=[inner]) + JdbcJoin(condition=[=($2, $10)], joinType=[inner]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_bill_cdemo_sk=[$2], cs_item_sk=[$3], $f4=[CAST($4):DECIMAL(12, 2)], $f5=[CAST($5):DECIMAL(12, 2)], $f6=[CAST($7):DECIMAL(12, 2)], $f7=[CAST($6):DECIMAL(12, 2)], $f8=[CAST($8):DECIMAL(12, 2)]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($3))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], cs_bill_cdemo_sk=[$4], cs_item_sk=[$15], cs_quantity=[$18], cs_list_price=[$20], cs_sales_price=[$21], cs_coupon_amt=[$27], cs_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(cd_demo_sk=[$0], $f10=[CAST($3):DECIMAL(12, 2)]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'M'), =($2, _UTF-16LE'College'), IS NOT NULL($0))]) + JdbcProject(cd_demo_sk=[$0], cd_gender=[$1], cd_education_status=[$3], cd_dep_count=[$6]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[cd1]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_addr_sk=[$2], $f9=[$3], cd_demo_sk=[$4], ca_address_sk=[$5], ca_county=[$6], ca_state=[$7], ca_country=[$8]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_addr_sk=[$2], $f9=[CAST($4):DECIMAL(12, 2)]) + JdbcFilter(condition=[AND(IN($3, 1, 4, 5, 9, 10, 12), IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$2], c_current_addr_sk=[$4], c_birth_month=[$12], c_birth_year=[$13]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(cd_demo_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cd_demo_sk=[$0]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[cd2]) + JdbcProject(ca_address_sk=[$0], ca_county=[$1], ca_state=[$2], ca_country=[$3]) + JdbcFilter(condition=[AND(IN($2, _UTF-16LE'AL':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MS':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'NC':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'ND':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'OK':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'TN':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'WI':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_county=[$7], ca_state=[$8], ca_country=[$10]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query19.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query19.q.out new file mode 100644 index 000000000000..df219f3af760 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query19.q.out @@ -0,0 +1,44 @@ +CBO PLAN: +HiveProject(brand_id=[$0], brand=[$1], i_manufact_id=[$2], i_manufact=[$3], ext_price=[$4]) + HiveSortLimit(sort0=[$4], sort1=[$5], sort2=[$6], sort3=[$2], sort4=[$3], dir0=[DESC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], fetch=[100]) + HiveProject(brand_id=[$0], brand=[$1], i_manufact_id=[$2], i_manufact=[$3], ext_price=[$4], (tok_table_or_col i_brand)=[$1], (tok_table_or_col i_brand_id)=[$0]) + HiveAggregate(group=[{13, 14, 15, 16}], agg#0=[sum($4)]) + HiveJoin(condition=[=($1, $12)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[AND(=($3, $10), <>($9, $11))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($2, $6)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2], ss_store_sk=[$3], ss_ext_sales_price=[$4], d_date_sk=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($5, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2], ss_store_sk=[$3], ss_ext_sales_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_customer_sk=[$3], ss_store_sk=[$7], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 11), =($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveJoin(condition=[=($1, $2)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(c_customer_sk=[$0], c_current_addr_sk=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$4]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + HiveProject(ca_address_sk=[$0], EXPR$0=[substr($1, 1, 5)]) + HiveProject(ca_address_sk=[$0], ca_zip=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_zip=[$9]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + HiveProject(s_store_sk=[$0], EXPR$0=[substr($1, 1, 5)]) + HiveProject(s_store_sk=[$0], s_zip=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0], s_zip=[$25]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject(i_item_sk=[$0], i_brand_id=[$1], i_brand=[$2], i_manufact_id=[$3], i_manufact=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_brand=[$2], i_manufact_id=[$3], i_manufact=[$4]) + JdbcFilter(condition=[AND(=($5, 7), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_brand=[$8], i_manufact_id=[$13], i_manufact=[$14], i_manager_id=[$20]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query2.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query2.q.out new file mode 100644 index 000000000000..a91653728aaa --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query2.q.out @@ -0,0 +1,52 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], dir0=[ASC]) + HiveProject(d_week_seq1=[$0], _c1=[round(/($1, $10), 2)], _c2=[round(/($2, $11), 2)], _c3=[round(/($3, $12), 2)], _c4=[round(/($4, $13), 2)], _c5=[round(/($5, $14), 2)], _c6=[round(/($6, $15), 2)], _c7=[round(/($7, $16), 2)]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4], $f5=[$5], $f6=[$6], $f7=[$7], d_week_seq=[$8], $f00=[$9], $f10=[$10], $f20=[$11], $f30=[$12], $f40=[$13], $f50=[$14], $f60=[$15], $f70=[$16], d_week_seq0=[$17]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, -($9, 53))], joinType=[inner]) + JdbcJoin(condition=[=($8, $0)], joinType=[inner]) + JdbcAggregate(group=[{0}], agg#0=[sum($1)], agg#1=[sum($2)], agg#2=[sum($3)], agg#3=[sum($4)], agg#4=[sum($5)], agg#5=[sum($6)], agg#6=[sum($7)]) + JdbcProject($f0=[$3], $f1=[CASE($4, $1, null:DECIMAL(7, 2))], $f2=[CASE($5, $1, null:DECIMAL(7, 2))], $f3=[CASE($6, $1, null:DECIMAL(7, 2))], $f4=[CASE($7, $1, null:DECIMAL(7, 2))], $f5=[CASE($8, $1, null:DECIMAL(7, 2))], $f6=[CASE($9, $1, null:DECIMAL(7, 2))], $f7=[CASE($10, $1, null:DECIMAL(7, 2))]) + JdbcJoin(condition=[=($2, $0)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_ext_sales_price=[$1]) + JdbcUnion(all=[true]) + JdbcProject(ws_sold_date_sk=[$0], ws_ext_sales_price=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ws_sold_date_sk=[$0], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(cs_sold_date_sk=[$0], cs_ext_sales_price=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cs_sold_date_sk=[$0], cs_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0], d_week_seq=[$1], EXPR$0=[=($2, _UTF-16LE'Sunday')], EXPR$1=[=($2, _UTF-16LE'Monday')], EXPR$2=[=($2, _UTF-16LE'Tuesday')], EXPR$3=[=($2, _UTF-16LE'Wednesday')], EXPR$4=[=($2, _UTF-16LE'Thursday')], EXPR$5=[=($2, _UTF-16LE'Friday')], EXPR$6=[=($2, _UTF-16LE'Saturday')]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(d_date_sk=[$0], d_week_seq=[$4], d_day_name=[$14]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(d_week_seq=[$0]) + JdbcFilter(condition=[AND(=($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_week_seq=[$4], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4], $f5=[$5], $f6=[$6], $f7=[$7], d_week_seq=[$8]) + JdbcJoin(condition=[=($8, $0)], joinType=[inner]) + JdbcAggregate(group=[{0}], agg#0=[sum($1)], agg#1=[sum($2)], agg#2=[sum($3)], agg#3=[sum($4)], agg#4=[sum($5)], agg#5=[sum($6)], agg#6=[sum($7)]) + JdbcProject($f0=[$3], $f1=[CASE($4, $1, null:DECIMAL(7, 2))], $f2=[CASE($5, $1, null:DECIMAL(7, 2))], $f3=[CASE($6, $1, null:DECIMAL(7, 2))], $f4=[CASE($7, $1, null:DECIMAL(7, 2))], $f5=[CASE($8, $1, null:DECIMAL(7, 2))], $f6=[CASE($9, $1, null:DECIMAL(7, 2))], $f7=[CASE($10, $1, null:DECIMAL(7, 2))]) + JdbcJoin(condition=[=($2, $0)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_ext_sales_price=[$1]) + JdbcUnion(all=[true]) + JdbcProject(ws_sold_date_sk=[$0], ws_ext_sales_price=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ws_sold_date_sk=[$0], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(cs_sold_date_sk=[$0], cs_ext_sales_price=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cs_sold_date_sk=[$0], cs_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0], d_week_seq=[$1], EXPR$0=[=($2, _UTF-16LE'Sunday')], EXPR$1=[=($2, _UTF-16LE'Monday')], EXPR$2=[=($2, _UTF-16LE'Tuesday')], EXPR$3=[=($2, _UTF-16LE'Wednesday')], EXPR$4=[=($2, _UTF-16LE'Thursday')], EXPR$5=[=($2, _UTF-16LE'Friday')], EXPR$6=[=($2, _UTF-16LE'Saturday')]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(d_date_sk=[$0], d_week_seq=[$4], d_day_name=[$14]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(d_week_seq=[$0]) + JdbcFilter(condition=[AND(=($1, 2002), IS NOT NULL($0))]) + JdbcProject(d_week_seq=[$4], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query20.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query20.q.out new file mode 100644 index 000000000000..fdcac192298f --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query20.q.out @@ -0,0 +1,22 @@ +CBO PLAN: +HiveProject(i_item_desc=[$0], i_category=[$1], i_class=[$2], i_current_price=[$3], itemrevenue=[$4], revenueratio=[$5]) + HiveSortLimit(sort0=[$1], sort1=[$2], sort2=[$6], sort3=[$0], sort4=[$5], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], fetch=[100]) + HiveProject(i_item_desc=[$1], i_category=[$4], i_class=[$3], i_current_price=[$2], itemrevenue=[$5], revenueratio=[/(*($5, 100:DECIMAL(10, 0)), sum($5) OVER (PARTITION BY $3 ORDER BY $3 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING))], (tok_table_or_col i_item_id)=[$0]) + HiveProject(i_item_id=[$0], i_item_desc=[$1], i_current_price=[$2], i_class=[$3], i_category=[$4], $f5=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{5, 6, 7, 8, 9}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$1], cs_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$15], cs_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 2001-01-12 00:00:00:TIMESTAMP(9), 2001-02-11 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$2], i_current_price=[$3], i_class=[$4], i_category=[$5]) + JdbcFilter(condition=[AND(IN($5, _UTF-16LE'Books':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Jewelry':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Sports':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$4], i_current_price=[$5], i_class=[$10], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query21.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query21.q.out new file mode 100644 index 000000000000..3711df80e1b8 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query21.q.out @@ -0,0 +1,27 @@ +CBO PLAN: +HiveProject(x.w_warehouse_name=[$0], x.i_item_id=[$1], x.inv_before=[$2], x.inv_after=[$3]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + JdbcFilter(condition=[AND(CASE(>($2, 0), <=(6.66667E-1, /(CAST($3):DOUBLE, CAST($2):DOUBLE)), false), CASE(>($2, 0), <=(/(CAST($3):DOUBLE, CAST($2):DOUBLE), 1.5E0), false))]) + JdbcAggregate(group=[{0, 1}], agg#0=[sum($2)], agg#1=[sum($3)]) + JdbcProject($f0=[$5], $f1=[$7], $f2=[CASE($9, $3, 0)], $f3=[CASE($10, $3, 0)]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcJoin(condition=[=($6, $1)], joinType=[inner]) + JdbcJoin(condition=[=($2, $4)], joinType=[inner]) + JdbcProject(inv_date_sk=[$0], inv_item_sk=[$1], inv_warehouse_sk=[$2], inv_quantity_on_hand=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcHiveTableScan(table=[[default, inventory]], table:alias=[inventory]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$2]) + JdbcHiveTableScan(table=[[default, warehouse]], table:alias=[warehouse]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 0.99:DECIMAL(3, 2), 1.49:DECIMAL(3, 2)), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_current_price=[$5]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], EXPR$0=[<(CAST($1):DATE, 1998-04-08)], EXPR$1=[>=(CAST($1):DATE, 1998-04-08)]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-03-09 00:00:00:TIMESTAMP(9), 1998-05-08 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query22.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query22.q.out new file mode 100644 index 000000000000..b35510e31f94 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query22.q.out @@ -0,0 +1,25 @@ +CBO PLAN: +HiveSortLimit(sort0=[$4], sort1=[$0], sort2=[$1], sort3=[$2], sort4=[$3], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], fetch=[100]) + HiveProject(i_product_name=[$3], i_brand=[$0], i_class=[$1], i_category=[$2], qoh=[/(CAST($4):DOUBLE, $5)]) + HiveAggregate(group=[{7, 8, 9, 10}], groups=[[{7, 8, 9, 10}, {7, 8, 10}, {7, 10}, {10}, {}]], agg#0=[sum($3)], agg#1=[count($3)]) + HiveProject(inv_date_sk=[$0], inv_item_sk=[$1], inv_warehouse_sk=[$2], inv_quantity_on_hand=[$3], d_date_sk=[$4], w_warehouse_sk=[$5], i_item_sk=[$6], i_brand=[$7], i_class=[$8], i_category=[$9], i_product_name=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(inv_date_sk=[$0], inv_item_sk=[$1], inv_warehouse_sk=[$2], inv_quantity_on_hand=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcHiveTableScan(table=[[default, inventory]], table:alias=[inventory]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(w_warehouse_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(w_warehouse_sk=[$0]) + JdbcHiveTableScan(table=[[default, warehouse]], table:alias=[warehouse]) + JdbcProject(i_item_sk=[$0], i_brand=[$1], i_class=[$2], i_category=[$3], i_product_name=[$4]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_brand=[$8], i_class=[$10], i_category=[$12], i_product_name=[$21]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query23.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query23.q.out new file mode 100644 index 000000000000..c860e89d85c7 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query23.q.out @@ -0,0 +1,150 @@ +CBO PLAN: +HiveProject(_c0=[$0]) + HiveAggregate(group=[{}], agg#0=[sum($0)]) + HiveProject(sales=[$0]) + HiveUnion(all=[true]) + HiveProject(sales=[*(CAST($3):DECIMAL(10, 0), $4)]) + HiveSemiJoin(condition=[=($1, $8)], joinType=[semi]) + HiveSemiJoin(condition=[=($2, $8)], joinType=[semi]) + HiveProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2], cs_quantity=[$3], cs_list_price=[$4], d_date_sk=[$5], d_year=[$6], d_moy=[$7]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2], cs_quantity=[$3], cs_list_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], cs_item_sk=[$15], cs_quantity=[$18], cs_list_price=[$20]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 1), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject($f1=[$1]) + HiveFilter(condition=[>($3, 4)]) + HiveProject($f0=[$2], i_item_sk=[$1], d_date=[$0], $f3=[$3]) + HiveAggregate(group=[{3, 4, 5}], agg#0=[count()]) + HiveJoin(condition=[=($1, $4)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], d_date_sk=[$2], d_date=[$3]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], d_date_sk=[$2], d_date=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(IN($2, 1999, 2000, 2001, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(i_item_sk=[$0], $f0=[substr($1, 1, 30)]) + HiveProject(i_item_sk=[$0], i_item_desc=[$1]) + HiveProject(i_item_sk=[$0], i_item_desc=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_desc=[$4]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(c_customer_sk=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(c_customer_sk=[$0]) + JdbcJoin(condition=[>($1, $2)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], $f1=[$1]) + JdbcFilter(condition=[IS NOT NULL($1)]) + JdbcAggregate(group=[{2}], agg#0=[sum($1)]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ss_customer_sk=[$0], $f1=[*(CAST($1):DECIMAL(10, 0), $2)]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ss_customer_sk=[$3], ss_quantity=[$10], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(c_customer_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(EXPR$0=[*(0.95:DECIMAL(16, 6), $0)]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcAggregate(group=[{}], agg#0=[max($1)]) + JdbcAggregate(group=[{3}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], $f1=[*(CAST($2):DECIMAL(10, 0), $3)]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_quantity=[$10], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(c_customer_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, 1999, 2000, 2001, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(sales=[*(CAST($3):DECIMAL(10, 0), $4)]) + HiveSemiJoin(condition=[=($2, $8)], joinType=[semi]) + HiveSemiJoin(condition=[=($1, $8)], joinType=[semi]) + HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_customer_sk=[$2], ws_quantity=[$3], ws_list_price=[$4], d_date_sk=[$5], d_year=[$6], d_moy=[$7]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_customer_sk=[$2], ws_quantity=[$3], ws_list_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_bill_customer_sk=[$4], ws_quantity=[$18], ws_list_price=[$20]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 1), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject($f1=[$1]) + HiveFilter(condition=[>($3, 4)]) + HiveProject($f0=[$2], i_item_sk=[$1], d_date=[$0], $f3=[$3]) + HiveAggregate(group=[{3, 4, 5}], agg#0=[count()]) + HiveJoin(condition=[=($1, $4)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], d_date_sk=[$2], d_date=[$3]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], d_date_sk=[$2], d_date=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(IN($2, 1999, 2000, 2001, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(i_item_sk=[$0], $f0=[substr($1, 1, 30)]) + HiveProject(i_item_sk=[$0], i_item_desc=[$1]) + HiveProject(i_item_sk=[$0], i_item_desc=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_desc=[$4]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(c_customer_sk=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(c_customer_sk=[$0]) + JdbcJoin(condition=[>($1, $2)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], $f1=[$1]) + JdbcFilter(condition=[IS NOT NULL($1)]) + JdbcAggregate(group=[{2}], agg#0=[sum($1)]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ss_customer_sk=[$0], $f1=[*(CAST($1):DECIMAL(10, 0), $2)]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ss_customer_sk=[$3], ss_quantity=[$10], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(c_customer_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(EXPR$0=[*(0.95:DECIMAL(16, 6), $0)]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcAggregate(group=[{}], agg#0=[max($1)]) + JdbcAggregate(group=[{3}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], $f1=[*(CAST($2):DECIMAL(10, 0), $3)]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_quantity=[$10], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(c_customer_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, 1999, 2000, 2001, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query24.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query24.q.out new file mode 100644 index 000000000000..3a25f5f5e59f --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query24.q.out @@ -0,0 +1,93 @@ +Warning: Shuffle Join MERGEJOIN[111][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 5' is a cross product +CBO PLAN: +HiveProject(c_last_name=[$0], c_first_name=[$1], s_store_name=[$2], paid=[$3]) + HiveJoin(condition=[>($3, $4)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(c_last_name=[$0], c_first_name=[$1], s_store_name=[$2], $f3=[$3]) + HiveFilter(condition=[IS NOT NULL($3)]) + HiveProject(c_last_name=[$2], c_first_name=[$1], s_store_name=[$0], $f3=[$3]) + HiveAggregate(group=[{5, 7, 8}], agg#0=[sum($9)]) + HiveProject(i_current_price=[$0], i_size=[$1], i_units=[$2], i_manager_id=[$3], ca_state=[$4], s_store_name=[$5], s_state=[$6], c_first_name=[$7], c_last_name=[$8], $f9=[$9]) + HiveAggregate(group=[{8, 9, 10, 11, 13, 17, 18, 22, 23}], agg#0=[sum($4)]) + HiveJoin(condition=[AND(=($1, $20), =($21, $12), <>($24, $15))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($2, $16)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ss_item_sk=[$0], ss_customer_sk=[$1], ss_store_sk=[$2], ss_ticket_number=[$3], ss_sales_price=[$4], sr_item_sk=[$5], sr_ticket_number=[$6], i_item_sk=[$7], i_current_price=[$8], i_size=[$9], i_units=[$10], i_manager_id=[$11]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcJoin(condition=[AND(=($3, $6), =($0, $5))], joinType=[inner]) + JdbcProject(ss_item_sk=[$0], ss_customer_sk=[$1], ss_store_sk=[$2], ss_ticket_number=[$3], ss_sales_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_item_sk=[$2], ss_customer_sk=[$3], ss_store_sk=[$7], ss_ticket_number=[$9], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(sr_item_sk=[$0], sr_ticket_number=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(sr_item_sk=[$2], sr_ticket_number=[$9]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(i_item_sk=[$0], i_current_price=[$1], i_size=[$2], i_units=[$4], i_manager_id=[$5]) + JdbcFilter(condition=[AND(=($3, _UTF-16LE'orchid'), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_current_price=[$5], i_size=[$15], i_color=[$17], i_units=[$18], i_manager_id=[$20]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveJoin(condition=[=($7, $2)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ca_address_sk=[$0], ca_state=[$1], ca_zip=[$2], EXPR$0=[UPPER($3)]) + HiveProject(ca_address_sk=[$0], ca_state=[$1], ca_zip=[$2], ca_country=[$3]) + HiveProject(ca_address_sk=[$0], ca_state=[$1], ca_zip=[$2], ca_country=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8], ca_zip=[$9], ca_country=[$10]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + HiveProject(s_store_sk=[$0], s_store_name=[$1], s_state=[$2], s_zip=[$3]) + HiveProject(s_store_sk=[$0], s_store_name=[$1], s_state=[$2], s_zip=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(s_store_sk=[$0], s_store_name=[$1], s_state=[$3], s_zip=[$4]) + JdbcFilter(condition=[AND(=($2, 7), IS NOT NULL($0), IS NOT NULL($4))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5], s_market_id=[$10], s_state=[$24], s_zip=[$25]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject(c_customer_sk=[$0], c_current_addr_sk=[$1], c_first_name=[$2], c_last_name=[$3], c_birth_country=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$4], c_first_name=[$8], c_last_name=[$9], c_birth_country=[$14]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + HiveProject(_o__c0=[*(0.05:DECIMAL(2, 2), CAST(/($0, $1)):DECIMAL(21, 6))]) + HiveFilter(condition=[IS NOT NULL(CAST(/($0, $1)):DECIMAL(21, 6))]) + HiveProject($f0=[$0], $f1=[$1]) + HiveAggregate(group=[{}], agg#0=[sum($10)], agg#1=[count($10)]) + HiveProject(i_current_price=[$0], i_size=[$1], i_color=[$2], i_units=[$3], i_manager_id=[$4], ca_state=[$5], s_store_name=[$6], s_state=[$7], c_first_name=[$8], c_last_name=[$9], $f10=[$10]) + HiveAggregate(group=[{8, 9, 10, 11, 12, 14, 18, 19, 23, 24}], agg#0=[sum($4)]) + HiveJoin(condition=[AND(=($1, $21), =($22, $13), <>($25, $16))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($2, $17)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ss_item_sk=[$0], ss_customer_sk=[$1], ss_store_sk=[$2], ss_ticket_number=[$3], ss_sales_price=[$4], sr_item_sk=[$5], sr_ticket_number=[$6], i_item_sk=[$7], i_current_price=[$8], i_size=[$9], i_color=[$10], i_units=[$11], i_manager_id=[$12]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcJoin(condition=[AND(=($3, $6), =($0, $5))], joinType=[inner]) + JdbcProject(ss_item_sk=[$0], ss_customer_sk=[$1], ss_store_sk=[$2], ss_ticket_number=[$3], ss_sales_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_item_sk=[$2], ss_customer_sk=[$3], ss_store_sk=[$7], ss_ticket_number=[$9], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(sr_item_sk=[$0], sr_ticket_number=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(sr_item_sk=[$2], sr_ticket_number=[$9]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(i_item_sk=[$0], i_current_price=[$1], i_size=[$2], i_color=[$3], i_units=[$4], i_manager_id=[$5]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_current_price=[$5], i_size=[$15], i_color=[$17], i_units=[$18], i_manager_id=[$20]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveJoin(condition=[=($7, $2)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ca_address_sk=[$0], ca_state=[$1], ca_zip=[$2], EXPR$0=[UPPER($3)]) + HiveProject(ca_address_sk=[$0], ca_state=[$1], ca_zip=[$2], ca_country=[$3]) + HiveProject(ca_address_sk=[$0], ca_state=[$1], ca_zip=[$2], ca_country=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8], ca_zip=[$9], ca_country=[$10]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + HiveProject(s_store_sk=[$0], s_store_name=[$1], s_state=[$2], s_zip=[$3]) + HiveProject(s_store_sk=[$0], s_store_name=[$1], s_state=[$2], s_zip=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(s_store_sk=[$0], s_store_name=[$1], s_state=[$3], s_zip=[$4]) + JdbcFilter(condition=[AND(=($2, 7), IS NOT NULL($0), IS NOT NULL($4))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5], s_market_id=[$10], s_state=[$24], s_zip=[$25]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject(c_customer_sk=[$0], c_current_addr_sk=[$1], c_first_name=[$2], c_last_name=[$3], c_birth_country=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$4], c_first_name=[$8], c_last_name=[$9], c_birth_country=[$14]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query25.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query25.q.out new file mode 100644 index 000000000000..c36091229c2e --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query25.q.out @@ -0,0 +1,49 @@ +CBO PLAN: +HiveProject(i_item_id=[$0], i_item_desc=[$1], s_store_id=[$2], s_store_name=[$3], store_sales_profit=[$4], store_returns_loss=[$5], catalog_sales_profit=[$6]) + HiveProject(i_item_id=[$0], i_item_desc=[$1], s_store_id=[$2], s_store_name=[$3], $f4=[$4], $f5=[$5], $f6=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], fetch=[100]) + JdbcProject(i_item_id=[$2], i_item_desc=[$3], s_store_id=[$0], s_store_name=[$1], $f4=[$4], $f5=[$5], $f6=[$6]) + JdbcAggregate(group=[{8, 9, 11, 12}], agg#0=[sum($5)], agg#1=[sum($17)], agg#2=[sum($22)]) + JdbcJoin(condition=[AND(=($2, $15), =($1, $14), =($4, $16))], joinType=[inner]) + JdbcJoin(condition=[=($10, $1)], joinType=[inner]) + JdbcJoin(condition=[=($7, $3)], joinType=[inner]) + JdbcJoin(condition=[=($6, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2], ss_store_sk=[$3], ss_ticket_number=[$4], ss_net_profit=[$5]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($4), IS NOT NULL($0), IS NOT NULL($3))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_customer_sk=[$3], ss_store_sk=[$7], ss_ticket_number=[$9], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 4), =($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1], s_store_name=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$4]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$1], sr_customer_sk=[$2], sr_ticket_number=[$3], sr_net_loss=[$4], d_date_sk=[$5], cs_sold_date_sk=[$6], cs_bill_customer_sk=[$7], cs_item_sk=[$8], cs_net_profit=[$9], d_date_sk0=[$10]) + JdbcJoin(condition=[AND(=($2, $7), =($1, $8))], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$1], sr_customer_sk=[$2], sr_ticket_number=[$3], sr_net_loss=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($3), IS NOT NULL($0))]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$2], sr_customer_sk=[$3], sr_ticket_number=[$9], sr_net_loss=[$19]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 4, 10), =($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d2]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2], cs_net_profit=[$3], d_date_sk=[$4]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2], cs_net_profit=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], cs_item_sk=[$15], cs_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 4, 10), =($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d3]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query26.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query26.q.out new file mode 100644 index 000000000000..a2871c807a67 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query26.q.out @@ -0,0 +1,32 @@ +CBO PLAN: +HiveProject(i_item_id=[$0], agg1=[$1], agg2=[$2], agg3=[$3], agg4=[$4]) + HiveProject(i_item_id=[$0], agg1=[$1], agg2=[$2], agg3=[$3], agg4=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], dir0=[ASC], fetch=[100]) + JdbcProject(i_item_id=[$0], agg1=[/(CAST($1):DOUBLE, $2)], agg2=[CAST(/($3, $4)):DECIMAL(11, 6)], agg3=[CAST(/($5, $6)):DECIMAL(11, 6)], agg4=[CAST(/($7, $8)):DECIMAL(11, 6)]) + JdbcAggregate(group=[{12}], agg#0=[sum($4)], agg#1=[count($4)], agg#2=[sum($5)], agg#3=[count($5)], agg#4=[sum($7)], agg#5=[count($7)], agg#6=[sum($6)], agg#7=[count($6)]) + JdbcJoin(condition=[=($2, $11)], joinType=[inner]) + JdbcJoin(condition=[=($3, $10)], joinType=[inner]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcJoin(condition=[=($1, $8)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_cdemo_sk=[$1], cs_item_sk=[$2], cs_promo_sk=[$3], cs_quantity=[$4], cs_list_price=[$5], cs_sales_price=[$6], cs_coupon_amt=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_cdemo_sk=[$4], cs_item_sk=[$15], cs_promo_sk=[$16], cs_quantity=[$18], cs_list_price=[$20], cs_sales_price=[$21], cs_coupon_amt=[$27]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(cd_demo_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'F'), =($2, _UTF-16LE'W'), =($3, _UTF-16LE'Primary'), IS NOT NULL($0))]) + JdbcProject(cd_demo_sk=[$0], cd_gender=[$1], cd_marital_status=[$2], cd_education_status=[$3]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[customer_demographics]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1998), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(p_promo_sk=[$0]) + JdbcFilter(condition=[AND(OR(=($1, _UTF-16LE'N'), =($2, _UTF-16LE'N')), IS NOT NULL($0))]) + JdbcProject(p_promo_sk=[$0], p_channel_email=[$9], p_channel_event=[$14]) + JdbcHiveTableScan(table=[[default, promotion]], table:alias=[promotion]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query27.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query27.q.out new file mode 100644 index 000000000000..b8a2cfd97597 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query27.q.out @@ -0,0 +1,32 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(i_item_id=[$0], s_state=[$1], g_state=[grouping($10, 0:BIGINT)], agg1=[/(CAST($2):DOUBLE, $3)], agg2=[CAST(/($4, $5)):DECIMAL(11, 6)], agg3=[CAST(/($6, $7)):DECIMAL(11, 6)], agg4=[CAST(/($8, $9)):DECIMAL(11, 6)]) + HiveAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], agg#0=[sum($2)], agg#1=[count($2)], agg#2=[sum($3)], agg#3=[count($3)], agg#4=[sum($4)], agg#5=[count($4)], agg#6=[sum($5)], agg#7=[count($5)], GROUPING__ID=[GROUPING__ID()]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4], $f5=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject($f0=[$13], $f1=[$11], $f2=[$4], $f3=[$5], $f4=[$7], $f5=[$6]) + JdbcJoin(condition=[=($1, $12)], joinType=[inner]) + JdbcJoin(condition=[=($3, $10)], joinType=[inner]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcJoin(condition=[=($2, $8)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_cdemo_sk=[$2], ss_store_sk=[$3], ss_quantity=[$4], ss_list_price=[$5], ss_sales_price=[$6], ss_coupon_amt=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0), IS NOT NULL($3), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_cdemo_sk=[$4], ss_store_sk=[$7], ss_quantity=[$10], ss_list_price=[$12], ss_sales_price=[$13], ss_coupon_amt=[$19]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(cd_demo_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'M'), =($2, _UTF-16LE'U'), =($3, _UTF-16LE'2 yr Degree'), IS NOT NULL($0))]) + JdbcProject(cd_demo_sk=[$0], cd_gender=[$1], cd_marital_status=[$2], cd_education_status=[$3]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[customer_demographics]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0], s_state=[$1]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'FL':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'LA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MI':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MO':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'SC':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'SD':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_state=[$24]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query28.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query28.q.out new file mode 100644 index 000000000000..5e52b7457a3e --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query28.q.out @@ -0,0 +1,55 @@ +Warning: Shuffle Join MERGEJOIN[29][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product +Warning: Shuffle Join MERGEJOIN[30][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Reducer 3' is a cross product +Warning: Shuffle Join MERGEJOIN[31][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3]] in Stage 'Reducer 4' is a cross product +Warning: Shuffle Join MERGEJOIN[32][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4]] in Stage 'Reducer 5' is a cross product +Warning: Shuffle Join MERGEJOIN[33][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5]] in Stage 'Reducer 6' is a cross product +CBO PLAN: +HiveProject(b1.b1_lp=[$0], b1.b1_cnt=[$1], b1.b1_cntd=[$2], b2.b2_lp=[$15], b2.b2_cnt=[$16], b2.b2_cntd=[$17], b3.b3_lp=[$12], b3.b3_cnt=[$13], b3.b3_cntd=[$14], b4.b4_lp=[$9], b4.b4_cnt=[$10], b4.b4_cntd=[$11], b5.b5_lp=[$6], b5.b5_cnt=[$7], b5.b5_cntd=[$8], b6.b6_lp=[$3], b6.b6_cnt=[$4], b6.b6_cntd=[$5]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(b1_lp=[$0], b1_cnt=[$1], b1_cntd=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(b1_lp=[CAST(/($0, $1)):DECIMAL(11, 6)], b1_cnt=[$1], b1_cntd=[$2]) + JdbcAggregate(group=[{}], agg#0=[sum($2)], agg#1=[count($2)], agg#2=[count(DISTINCT $2)]) + JdbcFilter(condition=[AND(OR(BETWEEN(false, $2, 11:DECIMAL(12, 2), 21:DECIMAL(12, 2)), BETWEEN(false, $3, 460:DECIMAL(12, 2), 1460:DECIMAL(12, 2)), BETWEEN(false, $1, 14:DECIMAL(12, 2), 34:DECIMAL(12, 2))), BETWEEN(false, $0, 0, 5))]) + JdbcProject(ss_quantity=[$10], ss_wholesale_cost=[$11], ss_list_price=[$12], ss_coupon_amt=[$19]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(b6_lp=[$0], b6_cnt=[$1], b6_cntd=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(b6_lp=[CAST(/($0, $1)):DECIMAL(11, 6)], b6_cnt=[$1], b6_cntd=[$2]) + JdbcAggregate(group=[{}], agg#0=[sum($2)], agg#1=[count($2)], agg#2=[count(DISTINCT $2)]) + JdbcFilter(condition=[AND(OR(BETWEEN(false, $2, 28:DECIMAL(12, 2), 38:DECIMAL(12, 2)), BETWEEN(false, $3, 2513:DECIMAL(12, 2), 3513:DECIMAL(12, 2)), BETWEEN(false, $1, 42:DECIMAL(12, 2), 62:DECIMAL(12, 2))), BETWEEN(false, $0, 26, 30))]) + JdbcProject(ss_quantity=[$10], ss_wholesale_cost=[$11], ss_list_price=[$12], ss_coupon_amt=[$19]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(b5_lp=[$0], b5_cnt=[$1], b5_cntd=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(b5_lp=[CAST(/($0, $1)):DECIMAL(11, 6)], b5_cnt=[$1], b5_cntd=[$2]) + JdbcAggregate(group=[{}], agg#0=[sum($2)], agg#1=[count($2)], agg#2=[count(DISTINCT $2)]) + JdbcFilter(condition=[AND(OR(BETWEEN(false, $2, 135:DECIMAL(12, 2), 145:DECIMAL(12, 2)), BETWEEN(false, $3, 14180:DECIMAL(12, 2), 15180:DECIMAL(12, 2)), BETWEEN(false, $1, 38:DECIMAL(12, 2), 58:DECIMAL(12, 2))), BETWEEN(false, $0, 21, 25))]) + JdbcProject(ss_quantity=[$10], ss_wholesale_cost=[$11], ss_list_price=[$12], ss_coupon_amt=[$19]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(b4_lp=[$0], b4_cnt=[$1], b4_cntd=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(b4_lp=[CAST(/($0, $1)):DECIMAL(11, 6)], b4_cnt=[$1], b4_cntd=[$2]) + JdbcAggregate(group=[{}], agg#0=[sum($2)], agg#1=[count($2)], agg#2=[count(DISTINCT $2)]) + JdbcFilter(condition=[AND(OR(BETWEEN(false, $2, 142:DECIMAL(12, 2), 152:DECIMAL(12, 2)), BETWEEN(false, $3, 3054:DECIMAL(12, 2), 4054:DECIMAL(12, 2)), BETWEEN(false, $1, 80:DECIMAL(12, 2), 100:DECIMAL(12, 2))), BETWEEN(false, $0, 16, 20))]) + JdbcProject(ss_quantity=[$10], ss_wholesale_cost=[$11], ss_list_price=[$12], ss_coupon_amt=[$19]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(b3_lp=[$0], b3_cnt=[$1], b3_cntd=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(b3_lp=[CAST(/($0, $1)):DECIMAL(11, 6)], b3_cnt=[$1], b3_cntd=[$2]) + JdbcAggregate(group=[{}], agg#0=[sum($2)], agg#1=[count($2)], agg#2=[count(DISTINCT $2)]) + JdbcFilter(condition=[AND(OR(BETWEEN(false, $2, 66:DECIMAL(12, 2), 76:DECIMAL(12, 2)), BETWEEN(false, $3, 920:DECIMAL(12, 2), 1920:DECIMAL(12, 2)), BETWEEN(false, $1, 4:DECIMAL(12, 2), 24:DECIMAL(12, 2))), BETWEEN(false, $0, 11, 15))]) + JdbcProject(ss_quantity=[$10], ss_wholesale_cost=[$11], ss_list_price=[$12], ss_coupon_amt=[$19]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(b2_lp=[$0], b2_cnt=[$1], b2_cntd=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(b2_lp=[CAST(/($0, $1)):DECIMAL(11, 6)], b2_cnt=[$1], b2_cntd=[$2]) + JdbcAggregate(group=[{}], agg#0=[sum($2)], agg#1=[count($2)], agg#2=[count(DISTINCT $2)]) + JdbcFilter(condition=[AND(OR(BETWEEN(false, $2, 91:DECIMAL(12, 2), 101:DECIMAL(12, 2)), BETWEEN(false, $3, 1430:DECIMAL(12, 2), 2430:DECIMAL(12, 2)), BETWEEN(false, $1, 32:DECIMAL(12, 2), 52:DECIMAL(12, 2))), BETWEEN(false, $0, 6, 10))]) + JdbcProject(ss_quantity=[$10], ss_wholesale_cost=[$11], ss_list_price=[$12], ss_coupon_amt=[$19]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query29.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query29.q.out new file mode 100644 index 000000000000..364e3d680573 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query29.q.out @@ -0,0 +1,49 @@ +CBO PLAN: +HiveProject(i_item_id=[$0], i_item_desc=[$1], s_store_id=[$2], s_store_name=[$3], store_sales_quantity=[$4], store_returns_quantity=[$5], catalog_sales_quantity=[$6]) + HiveProject(i_item_id=[$0], i_item_desc=[$1], s_store_id=[$2], s_store_name=[$3], $f4=[$4], $f5=[$5], $f6=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], fetch=[100]) + JdbcProject(i_item_id=[$2], i_item_desc=[$3], s_store_id=[$0], s_store_name=[$1], $f4=[$4], $f5=[$5], $f6=[$6]) + JdbcAggregate(group=[{8, 9, 11, 12}], agg#0=[sum($5)], agg#1=[sum($17)], agg#2=[sum($22)]) + JdbcJoin(condition=[AND(=($2, $15), =($1, $14), =($4, $16))], joinType=[inner]) + JdbcJoin(condition=[=($10, $1)], joinType=[inner]) + JdbcJoin(condition=[=($7, $3)], joinType=[inner]) + JdbcJoin(condition=[=($6, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2], ss_store_sk=[$3], ss_ticket_number=[$4], ss_quantity=[$5]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($4), IS NOT NULL($0), IS NOT NULL($3))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_customer_sk=[$3], ss_store_sk=[$7], ss_ticket_number=[$9], ss_quantity=[$10]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 4), =($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1], s_store_name=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$4]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$1], sr_customer_sk=[$2], sr_ticket_number=[$3], sr_return_quantity=[$4], d_date_sk=[$5], cs_sold_date_sk=[$6], cs_bill_customer_sk=[$7], cs_item_sk=[$8], cs_quantity=[$9], d_date_sk0=[$10]) + JdbcJoin(condition=[AND(=($2, $7), =($1, $8))], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$1], sr_customer_sk=[$2], sr_ticket_number=[$3], sr_return_quantity=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($3), IS NOT NULL($0))]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$2], sr_customer_sk=[$3], sr_ticket_number=[$9], sr_return_quantity=[$10]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 4, 7), =($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d2]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2], cs_quantity=[$3], d_date_sk=[$4]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2], cs_quantity=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], cs_item_sk=[$15], cs_quantity=[$18]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, 1999, 2000, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d3]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query3.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query3.q.out new file mode 100644 index 000000000000..ffc8ca52aeed --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query3.q.out @@ -0,0 +1,21 @@ +CBO PLAN: +HiveProject(dt.d_year=[$0], brand_id=[$1], brand=[$2], sum_agg=[$3]) + HiveProject(d_year=[$0], i_brand_id=[$1], i_brand=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$3], sort2=[$1], dir0=[ASC], dir1=[DESC], dir2=[ASC], fetch=[100]) + JdbcAggregate(group=[{4, 6, 7}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $5)], joinType=[inner]) + JdbcJoin(condition=[=($3, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0], d_year=[$1]) + JdbcFilter(condition=[AND(=($2, 12), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[dt]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_brand=[$2]) + JdbcFilter(condition=[AND(=($3, 436), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_brand=[$8], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query30.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query30.q.out new file mode 100644 index 000000000000..d1d19b4d0618 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query30.q.out @@ -0,0 +1,54 @@ +CBO PLAN: +HiveProject(c_customer_id=[$0], c_salutation=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4], c_birth_day=[$5], c_birth_month=[$6], c_birth_year=[$7], c_birth_country=[$8], c_login=[$9], c_email_address=[$10], c_last_review_date_sk=[$11], ctr_total_return=[$12]) + HiveProject(c_customer_id=[$0], c_salutation=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4], c_birth_day=[$5], c_birth_month=[$6], c_birth_year=[$7], c_birth_country=[$8], c_login=[$9], c_email_address=[$10], c_last_review_date_sk=[$11], ctr_total_return=[$12]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], sort4=[$4], sort5=[$5], sort6=[$6], sort7=[$7], sort8=[$8], sort9=[$9], sort10=[$10], sort11=[$11], sort12=[$12], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], dir5=[ASC], dir6=[ASC], dir7=[ASC], dir8=[ASC], dir9=[ASC], dir10=[ASC], dir11=[ASC], dir12=[ASC], fetch=[100]) + JdbcProject(c_customer_id=[$1], c_salutation=[$3], c_first_name=[$4], c_last_name=[$5], c_preferred_cust_flag=[$6], c_birth_day=[$7], c_birth_month=[$8], c_birth_year=[$9], c_birth_country=[$10], c_login=[$11], c_email_address=[$12], c_last_review_date_sk=[$13], ctr_total_return=[$17]) + JdbcJoin(condition=[=($15, $0)], joinType=[inner]) + JdbcJoin(condition=[=($14, $2)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_current_addr_sk=[$2], c_salutation=[$3], c_first_name=[$4], c_last_name=[$5], c_preferred_cust_flag=[$6], c_birth_day=[$7], c_birth_month=[$8], c_birth_year=[$9], c_birth_country=[$10], c_login=[$11], c_email_address=[$12], c_last_review_date_sk=[$13]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_current_addr_sk=[$4], c_salutation=[$7], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_day=[$11], c_birth_month=[$12], c_birth_year=[$13], c_birth_country=[$14], c_login=[$15], c_email_address=[$16], c_last_review_date_sk=[$17]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(ca_address_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'IL'), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(wr_returning_customer_sk=[$0], ca_state=[$1], $f2=[$2], _o__c0=[$3], ctr_state=[$4]) + JdbcJoin(condition=[AND(=($1, $4), >($2, $3))], joinType=[inner]) + JdbcProject(wr_returning_customer_sk=[$0], ca_state=[$1], $f2=[$2]) + JdbcFilter(condition=[IS NOT NULL($2)]) + JdbcAggregate(group=[{1, 6}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(wr_returned_date_sk=[$0], wr_returning_customer_sk=[$1], wr_returning_addr_sk=[$2], wr_return_amt=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(wr_returned_date_sk=[$0], wr_returning_customer_sk=[$7], wr_returning_addr_sk=[$10], wr_return_amt=[$15]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[web_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_state=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(_o__c0=[*(CAST(/($1, $2)):DECIMAL(21, 6), 1.2:DECIMAL(2, 1))], ctr_state=[$0]) + JdbcFilter(condition=[IS NOT NULL(CAST(/($1, $2)):DECIMAL(21, 6))]) + JdbcAggregate(group=[{1}], agg#0=[sum($2)], agg#1=[count($2)]) + JdbcAggregate(group=[{1, 6}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(wr_returned_date_sk=[$0], wr_returning_customer_sk=[$1], wr_returning_addr_sk=[$2], wr_return_amt=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(wr_returned_date_sk=[$0], wr_returning_customer_sk=[$7], wr_returning_addr_sk=[$10], wr_return_amt=[$15]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[web_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_state=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query31.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query31.q.out new file mode 100644 index 000000000000..9e0ce45e788e --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query31.q.out @@ -0,0 +1,104 @@ +CBO PLAN: +HiveProject(ss1.ca_county=[$0], ss1.d_year=[$1], web_q1_q2_increase=[$2], store_q1_q2_increase=[$3], web_q2_q3_increase=[$4], store_q2_q3_increase=[$5]) + HiveProject(ca_county=[$0], d_year=[$1], web_q1_q2_increase=[$2], store_q1_q2_increase=[$3], web_q2_q3_increase=[$4], store_q2_q3_increase=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ca_county=[$8], d_year=[CAST(2000):INTEGER], web_q1_q2_increase=[/($6, $1)], store_q1_q2_increase=[/($11, $9)], web_q2_q3_increase=[/($4, $6)], store_q2_q3_increase=[/($13, $11)]) + JdbcJoin(condition=[AND(=($8, $0), CASE(>($9, 0:DECIMAL(1, 0)), CASE($2, >(/($6, $1), /($11, $9)), false), false), CASE(>($11, 0:DECIMAL(1, 0)), CASE($7, >(/($4, $6), /($13, $11)), false), false))], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject($f0=[$0], $f3=[$1], EXPR$4=[>($1, 0:DECIMAL(1, 0))]) + JdbcAggregate(group=[{5}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_addr_sk=[$1], ws_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_addr_sk=[$7], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 1), =($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_county=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ca_address_sk=[$0], ca_county=[$7]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcAggregate(group=[{5}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_addr_sk=[$1], ws_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_addr_sk=[$7], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 3), =($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_county=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ca_address_sk=[$0], ca_county=[$7]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject($f0=[$0], $f3=[$1], EXPR$4=[>($1, 0:DECIMAL(1, 0))]) + JdbcAggregate(group=[{5}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_addr_sk=[$1], ws_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_addr_sk=[$7], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 2), =($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_county=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ca_address_sk=[$0], ca_county=[$7]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(ca_county=[$0], $f1=[$1], ca_county0=[$2], $f10=[$3], ca_county1=[$4], $f11=[$5]) + JdbcJoin(condition=[=($2, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcAggregate(group=[{5}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_addr_sk=[$1], ss_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_addr_sk=[$6], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 1), =($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_county=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ca_address_sk=[$0], ca_county=[$7]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcAggregate(group=[{5}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_addr_sk=[$1], ss_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_addr_sk=[$6], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 2), =($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_county=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ca_address_sk=[$0], ca_county=[$7]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcAggregate(group=[{5}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_addr_sk=[$1], ss_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_addr_sk=[$6], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 3), =($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_county=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ca_address_sk=[$0], ca_county=[$7]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query32.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query32.q.out new file mode 100644 index 000000000000..f39e6f94344f --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query32.q.out @@ -0,0 +1,33 @@ +CBO PLAN: +HiveProject(excess discount amount=[$0]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[sum($2)]) + JdbcJoin(condition=[AND(=($6, $3), >($2, $5))], joinType=[inner]) + JdbcJoin(condition=[=($4, $0)], joinType=[inner]) + JdbcJoin(condition=[=($3, $1)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$1], cs_ext_discount_amt=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$15], cs_ext_discount_amt=[$22]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(i_item_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 269), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-03-18 00:00:00:TIMESTAMP(9), 1998-06-16 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(_o__c0=[*(1.3:DECIMAL(2, 1), CAST(/($1, $2)):DECIMAL(11, 6))], cs_item_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL(CAST(/($1, $2)):DECIMAL(11, 6))]) + JdbcAggregate(group=[{1}], agg#0=[sum($2)], agg#1=[count($2)]) + JdbcJoin(condition=[=($3, $0)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$1], cs_ext_discount_amt=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$15], cs_ext_discount_amt=[$22]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-03-18 00:00:00:TIMESTAMP(9), 1998-06-16 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query33.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query33.q.out new file mode 100644 index 000000000000..372535fe410d --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query33.q.out @@ -0,0 +1,100 @@ +CBO PLAN: +HiveSortLimit(sort0=[$1], dir0=[ASC], fetch=[100]) + HiveProject(i_manufact_id=[$0], total_sales=[$1]) + HiveAggregate(group=[{0}], agg#0=[sum($1)]) + HiveProject(i_manufact_id=[$0], $f1=[$1]) + HiveUnion(all=[true]) + HiveProject(i_manufact_id=[$0], $f1=[$1]) + HiveAggregate(group=[{10}], agg#0=[sum($3)]) + HiveSemiJoin(condition=[=($10, $11)], joinType=[semi]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_addr_sk=[$2], ss_ext_sales_price=[$3], d_date_sk=[$4], d_year=[$5], d_moy=[$6], ca_address_sk=[$7], ca_gmt_offset=[$8], i_item_sk=[$9], i_manufact_id=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_addr_sk=[$2], ss_ext_sales_price=[$3], d_date_sk=[$8], d_year=[$9], d_moy=[$10], ca_address_sk=[$4], ca_gmt_offset=[$5], i_item_sk=[$6], i_manufact_id=[$7]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcJoin(condition=[=($2, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_addr_sk=[$2], ss_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_addr_sk=[$6], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$1]) + JdbcFilter(condition=[AND(=($1, -6:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$11]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(i_item_sk=[$0], i_manufact_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 3), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(i_manufact_id=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(i_manufact_id=[$1]) + JdbcFilter(condition=[AND(=($0, _UTF-16LE'Books'), IS NOT NULL($1))]) + JdbcProject(i_category=[$12], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(i_manufact_id=[$0], $f1=[$1]) + HiveAggregate(group=[{10}], agg#0=[sum($3)]) + HiveSemiJoin(condition=[=($10, $11)], joinType=[semi]) + HiveProject(cs_sold_date_sk=[$0], cs_bill_addr_sk=[$1], cs_item_sk=[$2], cs_ext_sales_price=[$3], d_date_sk=[$4], d_year=[$5], d_moy=[$6], ca_address_sk=[$7], ca_gmt_offset=[$8], i_item_sk=[$9], i_manufact_id=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_addr_sk=[$1], cs_item_sk=[$2], cs_ext_sales_price=[$3], d_date_sk=[$8], d_year=[$9], d_moy=[$10], ca_address_sk=[$4], ca_gmt_offset=[$5], i_item_sk=[$6], i_manufact_id=[$7]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcJoin(condition=[=($2, $6)], joinType=[inner]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_addr_sk=[$1], cs_item_sk=[$2], cs_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_addr_sk=[$6], cs_item_sk=[$15], cs_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$1]) + JdbcFilter(condition=[AND(=($1, -6:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$11]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(i_item_sk=[$0], i_manufact_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 3), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(i_manufact_id=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(i_manufact_id=[$1]) + JdbcFilter(condition=[AND(=($0, _UTF-16LE'Books'), IS NOT NULL($1))]) + JdbcProject(i_category=[$12], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(i_manufact_id=[$0], $f1=[$1]) + HiveAggregate(group=[{10}], agg#0=[sum($3)]) + HiveSemiJoin(condition=[=($10, $11)], joinType=[semi]) + HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_addr_sk=[$2], ws_ext_sales_price=[$3], d_date_sk=[$4], d_year=[$5], d_moy=[$6], ca_address_sk=[$7], ca_gmt_offset=[$8], i_item_sk=[$9], i_manufact_id=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_addr_sk=[$2], ws_ext_sales_price=[$3], d_date_sk=[$8], d_year=[$9], d_moy=[$10], ca_address_sk=[$4], ca_gmt_offset=[$5], i_item_sk=[$6], i_manufact_id=[$7]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcJoin(condition=[=($2, $4)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_addr_sk=[$2], ws_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_bill_addr_sk=[$7], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$1]) + JdbcFilter(condition=[AND(=($1, -6:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$11]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(i_item_sk=[$0], i_manufact_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 3), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(i_manufact_id=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(i_manufact_id=[$1]) + JdbcFilter(condition=[AND(=($0, _UTF-16LE'Books'), IS NOT NULL($1))]) + JdbcProject(i_category=[$12], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query34.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query34.q.out new file mode 100644 index 000000000000..c42dcfaaa99f --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query34.q.out @@ -0,0 +1,35 @@ +CBO PLAN: +HiveProject(c_last_name=[$0], c_first_name=[$1], c_salutation=[$2], c_preferred_cust_flag=[$3], ss_ticket_number=[$4], cnt=[$5]) + HiveProject(c_last_name=[$0], c_first_name=[$1], c_salutation=[$2], c_preferred_cust_flag=[$3], ss_ticket_number=[$4], cnt=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[DESC]) + JdbcProject(c_last_name=[$3], c_first_name=[$2], c_salutation=[$1], c_preferred_cust_flag=[$4], ss_ticket_number=[$5], cnt=[$7]) + JdbcJoin(condition=[=($6, $0)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_salutation=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0], c_salutation=[$7], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(ss_ticket_number=[$0], ss_customer_sk=[$1], $f2=[$2]) + JdbcFilter(condition=[BETWEEN(false, $2, 15:BIGINT, 20:BIGINT)]) + JdbcProject(ss_ticket_number=[$1], ss_customer_sk=[$0], $f2=[$2]) + JdbcAggregate(group=[{1, 4}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $7)], joinType=[inner]) + JdbcJoin(condition=[=($3, $6)], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], ss_hdemo_sk=[$2], ss_store_sk=[$3], ss_ticket_number=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($3), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_hdemo_sk=[$5], ss_store_sk=[$7], ss_ticket_number=[$9]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(OR(BETWEEN(false, $2, 1, 3), BETWEEN(false, $2, 25, 28)), IN($1, 2000, 2001, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_dom=[$9]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'Barrow County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Fairfield County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Huron County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Jackson County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Kittitas County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Maverick County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Mobile County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Pennington County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_county=[$23]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(>($3, 0), IN($1, _UTF-16LE'>10000':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'unknown':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), CASE(>($3, 0), >(/(CAST($2):DOUBLE, CAST($3):DOUBLE), 1.2), false), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_buy_potential=[$2], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query35.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query35.q.out new file mode 100644 index 000000000000..1e42c5c21bf1 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query35.q.out @@ -0,0 +1,64 @@ +CBO PLAN: +HiveProject(ca_state=[$0], cd_gender=[$1], cd_marital_status=[$2], cnt1=[$3], _c4=[$4], _c5=[$5], _c6=[$6], cd_dep_employed_count=[$7], cnt2=[$8], _c9=[$9], _c10=[$10], _c11=[$11], cd_dep_college_count=[$12], cnt3=[$13], _c14=[$14], _c15=[$15], _c16=[$16]) + HiveSortLimit(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$17], sort4=[$7], sort5=[$12], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], dir5=[ASC], fetch=[100]) + HiveProject(ca_state=[$0], cd_gender=[$1], cd_marital_status=[$2], cnt1=[$6], _o__c4=[/(CAST($7):DOUBLE, $8)], _o__c5=[$9], _o__c6=[$7], cd_dep_employed_count=[$4], cnt2=[$6], _o__c9=[/(CAST($10):DOUBLE, $11)], _o__c10=[$12], _o__c11=[$10], cd_dep_college_count=[$5], cnt3=[$6], _o__c14=[/(CAST($13):DOUBLE, $14)], _o__c15=[$15], _o__c16=[$13], (tok_table_or_col cd_dep_count)=[$3]) + HiveAggregate(group=[{4, 6, 7, 8, 9, 10}], agg#0=[count()], agg#1=[sum($8)], agg#2=[count($8)], agg#3=[max($8)], agg#4=[sum($9)], agg#5=[count($9)], agg#6=[max($9)], agg#7=[sum($10)], agg#8=[count($10)], agg#9=[max($10)]) + HiveFilter(condition=[OR(IS NOT NULL($11), IS NOT NULL($13))]) + HiveJoin(condition=[=($0, $14)], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($0, $12)], joinType=[left], algorithm=[none], cost=[not available]) + HiveSemiJoin(condition=[=($0, $11)], joinType=[semi]) + HiveProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_addr_sk=[$2], ca_address_sk=[$3], ca_state=[$4], cd_demo_sk=[$5], cd_gender=[$6], cd_marital_status=[$7], cd_dep_count=[$8], cd_dep_employed_count=[$9], cd_dep_college_count=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($5, $1)], joinType=[inner]) + JdbcJoin(condition=[=($2, $3)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_addr_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$2], c_current_addr_sk=[$4]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[c]) + JdbcProject(ca_address_sk=[$0], ca_state=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[ca]) + JdbcProject(cd_demo_sk=[$0], cd_gender=[$1], cd_marital_status=[$2], cd_dep_count=[$3], cd_dep_employed_count=[$4], cd_dep_college_count=[$5]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cd_demo_sk=[$0], cd_gender=[$1], cd_marital_status=[$2], cd_dep_count=[$6], cd_dep_employed_count=[$7], cd_dep_college_count=[$8]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[customer_demographics]) + HiveProject(ss_customer_sk=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ss_customer_sk=[$1]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(<($2, 4), =($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(literalTrue=[$0], ws_bill_customer_sk=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(literalTrue=[true], ws_bill_customer_sk=[$0]) + JdbcAggregate(group=[{1}]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$4]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(<($2, 4), =($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(literalTrue=[$0], cs_ship_customer_sk=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(literalTrue=[true], cs_ship_customer_sk=[$0]) + JdbcAggregate(group=[{1}]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_ship_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_ship_customer_sk=[$7]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(<($2, 4), =($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query36.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query36.q.out new file mode 100644 index 000000000000..6cbf110b1b82 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query36.q.out @@ -0,0 +1,29 @@ +CBO PLAN: +HiveProject(gross_margin=[$0], i_category=[$1], i_class=[$2], lochierarchy=[$3], rank_within_parent=[$4]) + HiveSortLimit(sort0=[$3], sort1=[$5], sort2=[$4], dir0=[DESC], dir1=[ASC], dir2=[ASC], fetch=[100]) + HiveProject(gross_margin=[/($2, $3)], i_category=[$0], i_class=[$1], lochierarchy=[+(grouping($4, 1:BIGINT), grouping($4, 0:BIGINT))], rank_within_parent=[rank() OVER (PARTITION BY +(grouping($4, 1:BIGINT), grouping($4, 0:BIGINT)), CASE(=(grouping($4, 0:BIGINT), CAST(0):BIGINT), $0, null:VARCHAR(2147483647) CHARACTER SET "UTF-16LE") ORDER BY /($2, $3) NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)], (tok_function when (= (tok_table_or_col lochierarchy) 0) (tok_table_or_col i_category))=[CASE(=(+(grouping($4, 1:BIGINT), grouping($4, 0:BIGINT)), 0), $0, null:VARCHAR(2147483647) CHARACTER SET "UTF-16LE")]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], GROUPING__ID=[$4]) + HiveAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], agg#0=[sum($2)], agg#1=[sum($3)], GROUPING__ID=[GROUPING__ID()]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject($f0=[$9], $f1=[$8], $f2=[$4], $f3=[$3]) + JdbcJoin(condition=[=($7, $1)], joinType=[inner]) + JdbcJoin(condition=[=($6, $2)], joinType=[inner]) + JdbcJoin(condition=[=($5, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_store_sk=[$2], ss_ext_sales_price=[$3], ss_net_profit=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_store_sk=[$7], ss_ext_sales_price=[$15], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'AL':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'FL':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'GA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'LA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MI':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MO':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'SC':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'SD':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_state=[$24]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(i_item_sk=[$0], i_class=[$1], i_category=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_class=[$10], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query37.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query37.q.out new file mode 100644 index 000000000000..44b61381b2ca --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query37.q.out @@ -0,0 +1,27 @@ +CBO PLAN: +HiveProject(i_item_id=[$0], i_item_desc=[$1], i_current_price=[$2]) + HiveProject(i_item_id=[$0], i_item_desc=[$1], i_current_price=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], dir0=[ASC], fetch=[100]) + JdbcAggregate(group=[{1, 2, 3}]) + JdbcJoin(condition=[=($6, $0)], joinType=[inner]) + JdbcJoin(condition=[=($4, $0)], joinType=[inner]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$2], i_current_price=[$3]) + JdbcFilter(condition=[AND(IN($4, 678, 849, 918, 964), BETWEEN(false, $3, 22:DECIMAL(12, 2), 52:DECIMAL(12, 2)), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$4], i_current_price=[$5], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(cs_item_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cs_item_sk=[$15]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(inv_date_sk=[$0], inv_item_sk=[$1], d_date_sk=[$2]) + JdbcJoin(condition=[=($2, $0)], joinType=[inner]) + JdbcProject(inv_date_sk=[$0], inv_item_sk=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 100, 500), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(inv_date_sk=[$0], inv_item_sk=[$1], inv_quantity_on_hand=[$3]) + JdbcHiveTableScan(table=[[default, inventory]], table:alias=[inventory]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 2001-06-02 00:00:00:TIMESTAMP(9), 2001-08-01 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query38.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query38.q.out new file mode 100644 index 000000000000..a6e8ef4507b7 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query38.q.out @@ -0,0 +1,69 @@ +CBO PLAN: +HiveProject(_c0=[$0]) + HiveAggregate(group=[{}], agg#0=[count()]) + HiveProject(c_last_name=[$0], c_first_name=[$1], d_date=[$2], $f3=[$3]) + HiveFilter(condition=[=($3, 3)]) + HiveAggregate(group=[{0, 1, 2}], agg#0=[count($3)]) + HiveProject(c_last_name=[$0], c_first_name=[$1], d_date=[$2], $f3=[$3]) + HiveUnion(all=[true]) + HiveProject(c_last_name=[$0], c_first_name=[$1], d_date=[$2], $f3=[$3]) + HiveProject(c_last_name=[$0], c_first_name=[$1], d_date=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(c_last_name=[$2], c_first_name=[$1], d_date=[$0], $f3=[$3]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[count()]) + JdbcAggregate(group=[{3, 5, 6}]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$1], c_last_name=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + HiveProject(c_last_name=[$0], c_first_name=[$1], d_date=[$2], $f3=[$3]) + HiveProject(c_last_name=[$0], c_first_name=[$1], d_date=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(c_last_name=[$2], c_first_name=[$1], d_date=[$0], $f3=[$3]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[count()]) + JdbcAggregate(group=[{3, 5, 6}]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$1], c_last_name=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + HiveProject(c_last_name=[$0], c_first_name=[$1], d_date=[$2], $f3=[$3]) + HiveProject(c_last_name=[$0], c_first_name=[$1], d_date=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(c_last_name=[$2], c_first_name=[$1], d_date=[$0], $f3=[$3]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[count()]) + JdbcAggregate(group=[{3, 5, 6}]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$4]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$1], c_last_name=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query39.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query39.q.out new file mode 100644 index 000000000000..893cf39f3188 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query39.q.out @@ -0,0 +1,52 @@ +CBO PLAN: +HiveProject(inv1.w_warehouse_sk=[$0], inv1.i_item_sk=[$1], inv1.d_moy=[$2], inv1.mean=[$3], inv1.cov=[$4], inv2.w_warehouse_sk=[$5], inv2.i_item_sk=[$6], inv2.d_moy=[$7], inv2.mean=[$8], inv2.cov=[$9]) + HiveProject(w_warehouse_sk=[$0], i_item_sk=[$1], d_moy=[$2], mean=[$3], cov=[$4], w_warehouse_sk1=[$5], i_item_sk1=[$6], d_moy1=[$7], mean1=[$8], cov1=[$9]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(w_warehouse_sk=[$0], i_item_sk=[$1], d_moy=[CAST(4):INTEGER], mean=[$2], cov=[$3], w_warehouse_sk1=[$4], i_item_sk1=[$5], d_moy1=[CAST(5):INTEGER], mean1=[$6], cov1=[$7]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], sort4=[$6], sort5=[$7], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], dir5=[ASC]) + JdbcJoin(condition=[AND(=($1, $5), =($0, $4))], joinType=[inner]) + JdbcProject(w_warehouse_sk=[$1], i_item_sk=[$2], mean=[/(CAST($6):DOUBLE, $7)], cov=[CASE(=(/(CAST($6):DOUBLE, $7), 0E0), null:DOUBLE, /(POWER(/(-($3, /(*($4, $4), $5)), CASE(=($5, 1), null:BIGINT, -($5, 1))), 0.5:DECIMAL(2, 1)), /(CAST($6):DOUBLE, $7)))]) + JdbcFilter(condition=[CASE(=(/(CAST($6):DOUBLE, $7), 0E0), false, >(/(POWER(/(-($3, /(*($4, $4), $5)), CASE(=($5, 1), null:BIGINT, -($5, 1))), 0.5:DECIMAL(2, 1)), /(CAST($6):DOUBLE, $7)), 1))]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[sum($5)], agg#1=[sum($4)], agg#2=[count($4)], agg#3=[sum($3)], agg#4=[count($3)]) + JdbcProject($f0=[$7], $f1=[$6], $f2=[$4], $f4=[$3], $f40=[CAST($3):DOUBLE], $f6=[*(CAST($3):DOUBLE, CAST($3):DOUBLE)]) + JdbcJoin(condition=[=($2, $6)], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcProject(inv_date_sk=[$0], inv_item_sk=[$1], inv_warehouse_sk=[$2], inv_quantity_on_hand=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($0))]) + JdbcHiveTableScan(table=[[default, inventory]], table:alias=[inventory]) + JdbcProject(i_item_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 4), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$2]) + JdbcHiveTableScan(table=[[default, warehouse]], table:alias=[warehouse]) + JdbcProject(w_warehouse_sk=[$1], i_item_sk=[$2], mean=[/(CAST($6):DOUBLE, $7)], cov=[CASE(=(/(CAST($6):DOUBLE, $7), 0E0), null:DOUBLE, /(POWER(/(-($3, /(*($4, $4), $5)), CASE(=($5, 1), null:BIGINT, -($5, 1))), 0.5:DECIMAL(2, 1)), /(CAST($6):DOUBLE, $7)))]) + JdbcFilter(condition=[CASE(=(/(CAST($6):DOUBLE, $7), 0E0), false, >(/(POWER(/(-($3, /(*($4, $4), $5)), CASE(=($5, 1), null:BIGINT, -($5, 1))), 0.5:DECIMAL(2, 1)), /(CAST($6):DOUBLE, $7)), 1))]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[sum($5)], agg#1=[sum($4)], agg#2=[count($4)], agg#3=[sum($3)], agg#4=[count($3)]) + JdbcProject($f0=[$7], $f1=[$6], $f2=[$4], $f4=[$3], $f40=[CAST($3):DOUBLE], $f6=[*(CAST($3):DOUBLE, CAST($3):DOUBLE)]) + JdbcJoin(condition=[=($2, $6)], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcProject(inv_date_sk=[$0], inv_item_sk=[$1], inv_warehouse_sk=[$2], inv_quantity_on_hand=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($0))]) + JdbcHiveTableScan(table=[[default, inventory]], table:alias=[inventory]) + JdbcProject(i_item_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 5), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$2]) + JdbcHiveTableScan(table=[[default, warehouse]], table:alias=[warehouse]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query4.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query4.q.out new file mode 100644 index 000000000000..b97d7ae90050 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query4.q.out @@ -0,0 +1,111 @@ +CBO PLAN: +HiveProject(t_s_secyear.customer_id=[$0], t_s_secyear.customer_first_name=[$1], t_s_secyear.customer_last_name=[$2], t_s_secyear.customer_birth_country=[$3]) + HiveProject(customer_id=[$0], customer_first_name=[$1], customer_last_name=[$2], customer_birth_country=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], fetch=[100]) + JdbcProject(customer_id=[$13], customer_first_name=[$14], customer_last_name=[$15], customer_birth_country=[$16]) + JdbcJoin(condition=[AND(=($13, $0), CASE($2, CASE($9, >(/($4, $8), /($17, $1)), false), false))], joinType=[inner]) + JdbcJoin(condition=[AND(=($0, $10), CASE($12, CASE($9, >(/($4, $8), /($6, $11)), false), false))], joinType=[inner]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(customer_id=[$0], year_total=[$7], EXPR$131=[>($7, 0:DECIMAL(1, 0))]) + JdbcFilter(condition=[>($7, 0:DECIMAL(1, 0))]) + JdbcAggregate(group=[{1, 2, 3, 4, 5, 6, 7}], agg#0=[sum($10)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4], c_birth_country=[$5], c_login=[$6], c_email_address=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], $f8=[/(+(-(-($5, $4), $2), $3), 2:DECIMAL(10, 0))]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_ext_discount_amt=[$14], ss_ext_sales_price=[$15], ss_ext_wholesale_cost=[$16], ss_ext_list_price=[$17]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(customer_id=[$0], year_total=[$7]) + JdbcAggregate(group=[{1, 2, 3, 4, 5, 6, 7}], agg#0=[sum($10)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4], c_birth_country=[$5], c_login=[$6], c_email_address=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], $f8=[/(+(-(-($5, $4), $2), $3), 2:DECIMAL(10, 0))]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], cs_ext_discount_amt=[$22], cs_ext_sales_price=[$23], cs_ext_wholesale_cost=[$24], cs_ext_list_price=[$25]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(customer_id=[$0], year_total=[$7]) + JdbcAggregate(group=[{1, 2, 3, 4, 5, 6, 7}], agg#0=[sum($10)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4], c_birth_country=[$5], c_login=[$6], c_email_address=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$1], $f8=[/(+(-(-($5, $4), $2), $3), 2:DECIMAL(10, 0))]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$4], ws_ext_discount_amt=[$22], ws_ext_sales_price=[$23], ws_ext_wholesale_cost=[$24], ws_ext_list_price=[$25]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(customer_id=[$0], year_total=[$7], EXPR$1=[>($7, 0:DECIMAL(1, 0))]) + JdbcFilter(condition=[>($7, 0:DECIMAL(1, 0))]) + JdbcAggregate(group=[{1, 2, 3, 4, 5, 6, 7}], agg#0=[sum($10)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4], c_birth_country=[$5], c_login=[$6], c_email_address=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], $f8=[/(+(-(-($5, $4), $2), $3), 2:DECIMAL(10, 0))]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], cs_ext_discount_amt=[$22], cs_ext_sales_price=[$23], cs_ext_wholesale_cost=[$24], cs_ext_list_price=[$25]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(customer_id=[$0], year_total=[$7], EXPR$0=[>($7, 0:DECIMAL(1, 0))]) + JdbcFilter(condition=[>($7, 0:DECIMAL(1, 0))]) + JdbcAggregate(group=[{1, 2, 3, 4, 5, 6, 7}], agg#0=[sum($10)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4], c_birth_country=[$5], c_login=[$6], c_email_address=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$1], $f8=[/(+(-(-($5, $4), $2), $3), 2:DECIMAL(10, 0))]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$4], ws_ext_discount_amt=[$22], ws_ext_sales_price=[$23], ws_ext_wholesale_cost=[$24], ws_ext_list_price=[$25]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(customer_id=[$0], customer_first_name=[$1], customer_last_name=[$2], customer_birth_country=[$4], year_total=[$7]) + JdbcAggregate(group=[{1, 2, 3, 4, 5, 6, 7}], agg#0=[sum($10)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4], c_birth_country=[$5], c_login=[$6], c_email_address=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10], c_birth_country=[$14], c_login=[$15], c_email_address=[$16]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], $f8=[/(+(-(-($5, $4), $2), $3), 2:DECIMAL(10, 0))]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_ext_discount_amt=[$14], ss_ext_sales_price=[$15], ss_ext_wholesale_cost=[$16], ss_ext_list_price=[$17]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query40.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query40.q.out new file mode 100644 index 000000000000..b70b17f504ad --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query40.q.out @@ -0,0 +1,32 @@ +CBO PLAN: +HiveProject(w_state=[$0], i_item_id=[$1], sales_before=[$2], sales_after=[$3]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + JdbcAggregate(group=[{0, 1}], agg#0=[sum($2)], agg#1=[sum($3)]) + JdbcProject($f0=[$9], $f1=[$11], $f2=[CASE($13, -($4, CASE(IS NOT NULL($7), $7, 0:DECIMAL(12, 2))), 0:DECIMAL(13, 2))], $f3=[CASE($14, -($4, CASE(IS NOT NULL($7), $7, 0:DECIMAL(12, 2))), 0:DECIMAL(13, 2))]) + JdbcJoin(condition=[=($0, $12)], joinType=[inner]) + JdbcJoin(condition=[=($10, $2)], joinType=[inner]) + JdbcJoin(condition=[=($1, $8)], joinType=[inner]) + JdbcJoin(condition=[AND(=($3, $6), =($2, $5))], joinType=[left]) + JdbcProject(cs_sold_date_sk=[$0], cs_warehouse_sk=[$1], cs_item_sk=[$2], cs_order_number=[$3], cs_sales_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_warehouse_sk=[$14], cs_item_sk=[$15], cs_order_number=[$17], cs_sales_price=[$21]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(cr_item_sk=[$0], cr_order_number=[$1], cr_refunded_cash=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cr_item_sk=[$2], cr_order_number=[$16], cr_refunded_cash=[$23]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + JdbcProject(w_warehouse_sk=[$0], w_state=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(w_warehouse_sk=[$0], w_state=[$10]) + JdbcHiveTableScan(table=[[default, warehouse]], table:alias=[warehouse]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 0.99:DECIMAL(3, 2), 1.49:DECIMAL(3, 2)), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_current_price=[$5]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], EXPR$0=[<(CAST($1):DATE, 1998-04-08)], EXPR$1=[>=(CAST($1):DATE, 1998-04-08)]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-03-09 00:00:00:TIMESTAMP(9), 1998-05-08 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query41.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query41.q.out new file mode 100644 index 000000000000..439778d3173c --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query41.q.out @@ -0,0 +1,18 @@ +CBO PLAN: +HiveProject(i_product_name=[$0]) + HiveProject(i_product_name=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], dir0=[ASC], fetch=[100]) + JdbcAggregate(group=[{1}]) + JdbcJoin(condition=[=($2, $0)], joinType=[inner]) + JdbcProject(i_manufact=[$1], i_product_name=[$2]) + JdbcFilter(condition=[AND(BETWEEN(false, $0, 970, 1010), IS NOT NULL($1))]) + JdbcProject(i_manufact_id=[$13], i_manufact=[$14], i_product_name=[$21]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[i1]) + JdbcProject(i_manufact=[$0]) + JdbcFilter(condition=[>($1, 0)]) + JdbcAggregate(group=[{1}], agg#0=[count()]) + JdbcFilter(condition=[AND(OR(AND(=($0, _UTF-16LE'Women'), IN($3, _UTF-16LE'frosted':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'rose':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($4, _UTF-16LE'Gross':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Lb':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'large':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'medium':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")), AND(=($0, _UTF-16LE'Women'), IN($3, _UTF-16LE'black':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'chocolate':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($4, _UTF-16LE'Box':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Dram':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'economy':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'petite':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")), AND(=($0, _UTF-16LE'Men'), IN($3, _UTF-16LE'magenta':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'slate':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($4, _UTF-16LE'Bundle':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Carton':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'N/A':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'small':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")), AND(=($0, _UTF-16LE'Men'), IN($3, _UTF-16LE'cornflower':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'firebrick':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($4, _UTF-16LE'Oz':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Pound':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'large':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'medium':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")), AND(=($0, _UTF-16LE'Women'), IN($3, _UTF-16LE'almond':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'steel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($4, _UTF-16LE'Case':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Tsp':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'large':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'medium':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")), AND(=($0, _UTF-16LE'Women'), IN($3, _UTF-16LE'aquamarine':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'purple':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($4, _UTF-16LE'Bunch':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Gram':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'economy':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'petite':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")), AND(=($0, _UTF-16LE'Men'), IN($3, _UTF-16LE'lavender':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'papaya':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($4, _UTF-16LE'Cup':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Pallet':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'N/A':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'small':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")), AND(=($0, _UTF-16LE'Men'), IN($3, _UTF-16LE'cyan':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'maroon':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($4, _UTF-16LE'Each':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'N/A':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'large':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'medium':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"))), IN($0, _UTF-16LE'Men':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Women':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'N/A':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'economy':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'large':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'medium':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'petite':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'small':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($3, _UTF-16LE'almond':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'aquamarine':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'black':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'chocolate':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'cornflower':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'cyan':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'firebrick':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'frosted':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'lavender':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'magenta':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'maroon':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'papaya':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'purple':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'rose':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'slate':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'steel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($4, _UTF-16LE'Box':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Bunch':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Bundle':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Carton':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Case':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Cup':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Dram':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Each':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Gram':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Gross':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Lb':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'N/A':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Oz':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Pallet':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Pound':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Tsp':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($1))]) + JdbcProject(i_category=[$12], i_manufact=[$14], i_size=[$15], i_color=[$17], i_units=[$18]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query42.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query42.q.out new file mode 100644 index 000000000000..9251c1aecbc4 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query42.q.out @@ -0,0 +1,23 @@ +CBO PLAN: +HiveProject(dt.d_year=[$0], item.i_category_id=[$1], item.i_category=[$2], _c3=[$3]) + HiveProject(d_year=[$0], i_category_id=[$1], i_category=[$2], _o__c3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(d_year=[CAST(1998):INTEGER], i_category_id=[$0], i_category=[$1], _o__c3=[$2]) + JdbcSort(sort0=[$3], sort1=[$0], sort2=[$1], dir0=[DESC], dir1=[ASC], dir2=[ASC], fetch=[100]) + JdbcProject(i_category_id=[$0], i_category=[$1], _o__c3=[$2], (tok_function sum (tok_table_or_col ss_ext_sales_price))=[$2]) + JdbcAggregate(group=[{5, 6}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($3, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 12), =($1, 1998), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[dt]) + JdbcProject(i_item_sk=[$0], i_category_id=[$1], i_category=[$2]) + JdbcFilter(condition=[AND(=($3, 1), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_category_id=[$11], i_category=[$12], i_manager_id=[$20]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query43.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query43.q.out new file mode 100644 index 000000000000..9b1749aa7b66 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query43.q.out @@ -0,0 +1,22 @@ +CBO PLAN: +HiveProject(s_store_name=[$0], s_store_id=[$1], sun_sales=[$2], mon_sales=[$3], tue_sales=[$4], wed_sales=[$5], thu_sales=[$6], fri_sales=[$7], sat_sales=[$8]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4], $f5=[$5], $f6=[$6], $f7=[$7], $f8=[$8]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], sort4=[$4], sort5=[$5], sort6=[$6], sort7=[$7], sort8=[$8], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], dir5=[ASC], dir6=[ASC], dir7=[ASC], dir8=[ASC], fetch=[100]) + JdbcAggregate(group=[{0, 1}], agg#0=[sum($2)], agg#1=[sum($3)], agg#2=[sum($4)], agg#3=[sum($5)], agg#4=[sum($6)], agg#5=[sum($7)], agg#6=[sum($8)]) + JdbcProject($f0=[$5], $f1=[$4], $f2=[CASE($7, $2, null:DECIMAL(7, 2))], $f3=[CASE($8, $2, null:DECIMAL(7, 2))], $f4=[CASE($9, $2, null:DECIMAL(7, 2))], $f5=[CASE($10, $2, null:DECIMAL(7, 2))], $f6=[CASE($11, $2, null:DECIMAL(7, 2))], $f7=[CASE($12, $2, null:DECIMAL(7, 2))], $f8=[CASE($13, $2, null:DECIMAL(7, 2))]) + JdbcJoin(condition=[=($6, $0)], joinType=[inner]) + JdbcJoin(condition=[=($3, $1)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$1], ss_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$7], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1], s_store_name=[$2]) + JdbcFilter(condition=[AND(=($3, -6:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1], s_store_name=[$5], s_gmt_offset=[$27]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(d_date_sk=[$0], EXPR$0=[=($2, _UTF-16LE'Sunday')], EXPR$1=[=($2, _UTF-16LE'Monday')], EXPR$2=[=($2, _UTF-16LE'Tuesday')], EXPR$3=[=($2, _UTF-16LE'Wednesday')], EXPR$4=[=($2, _UTF-16LE'Thursday')], EXPR$5=[=($2, _UTF-16LE'Friday')], EXPR$6=[=($2, _UTF-16LE'Saturday')]) + JdbcFilter(condition=[AND(=($1, 1998), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_day_name=[$14]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query44.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query44.q.out new file mode 100644 index 000000000000..fdbeff0c60b2 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query44.q.out @@ -0,0 +1,56 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], dir0=[ASC], fetch=[100]) + HiveProject(asceding.rnk=[$3], best_performing=[$1], worst_performing=[$7]) + HiveJoin(condition=[=($3, $5)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($0, $2)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(i_item_sk=[$0], i_product_name=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_product_name=[$21]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[i1]) + HiveProject(item_sk=[$0], rank_window_0=[$1]) + HiveFilter(condition=[AND(<($1, 11), IS NOT NULL($0))]) + HiveProject(item_sk=[$0], rank_window_0=[rank() OVER (PARTITION BY 0 ORDER BY $1 NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject($f0=[$0], $f1=[$1], rank_col=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[>($1, *(0.9:DECIMAL(1, 1), $2))], joinType=[inner]) + JdbcProject($f0=[$0], $f1=[CAST(/($1, $2)):DECIMAL(11, 6)]) + JdbcFilter(condition=[IS NOT NULL(CAST(/($1, $2)):DECIMAL(11, 6))]) + JdbcAggregate(group=[{0}], agg#0=[sum($2)], agg#1=[count($2)]) + JdbcFilter(condition=[=($1, 410)]) + JdbcProject(ss_item_sk=[$2], ss_store_sk=[$7], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[ss1]) + JdbcProject(rank_col=[CAST(/($1, $2)):DECIMAL(11, 6)]) + JdbcFilter(condition=[IS NOT NULL(CAST(/($1, $2)):DECIMAL(11, 6))]) + JdbcAggregate(group=[{0}], agg#0=[sum($1)], agg#1=[count($1)]) + JdbcProject($f0=[true], $f1=[$2]) + JdbcFilter(condition=[AND(=($1, 410), IS NULL($0))]) + JdbcProject(ss_hdemo_sk=[$5], ss_store_sk=[$7], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(item_sk=[$0], rank_window_0=[$1], i_item_sk=[$2], i_product_name=[$3]) + HiveJoin(condition=[=($2, $0)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(item_sk=[$0], rank_window_0=[$1]) + HiveFilter(condition=[AND(<($1, 11), IS NOT NULL($0))]) + HiveProject(item_sk=[$0], rank_window_0=[rank() OVER (PARTITION BY 0 ORDER BY $1 DESC NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject($f0=[$0], $f1=[$1], rank_col=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[>($1, *(0.9:DECIMAL(1, 1), $2))], joinType=[inner]) + JdbcProject($f0=[$0], $f1=[CAST(/($1, $2)):DECIMAL(11, 6)]) + JdbcFilter(condition=[IS NOT NULL(CAST(/($1, $2)):DECIMAL(11, 6))]) + JdbcAggregate(group=[{0}], agg#0=[sum($2)], agg#1=[count($2)]) + JdbcFilter(condition=[=($1, 410)]) + JdbcProject(ss_item_sk=[$2], ss_store_sk=[$7], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[ss1]) + JdbcProject(rank_col=[CAST(/($1, $2)):DECIMAL(11, 6)]) + JdbcFilter(condition=[IS NOT NULL(CAST(/($1, $2)):DECIMAL(11, 6))]) + JdbcAggregate(group=[{0}], agg#0=[sum($1)], agg#1=[count($1)]) + JdbcProject($f0=[true], $f1=[$2]) + JdbcFilter(condition=[AND(=($1, 410), IS NULL($0))]) + JdbcProject(ss_hdemo_sk=[$5], ss_store_sk=[$7], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(i_item_sk=[$0], i_product_name=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_product_name=[$21]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[i2]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query45.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query45.q.out new file mode 100644 index 000000000000..db5073102529 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query45.q.out @@ -0,0 +1,51 @@ +Warning: Shuffle Join MERGEJOIN[42][tables = [$hdt$_1, $hdt$_2]] in Stage 'Reducer 2' is a cross product +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(ca_zip=[$1], ca_county=[$0], _c2=[$2]) + HiveAggregate(group=[{7, 8}], agg#0=[sum($3)]) + HiveFilter(condition=[OR(AND(<>($14, 0), IS NOT NULL($16)), IN(substr($8, 1, 5), _UTF-16LE'85669':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'86197':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'88274':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'83405':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'86475':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'85392':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'85460':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'80348':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'81792':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"))]) + HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_customer_sk=[$2], ws_sales_price=[$3], c_customer_sk=[$10], c_current_addr_sk=[$11], ca_address_sk=[$7], ca_county=[$8], ca_zip=[$9], d_date_sk=[$4], d_year=[$5], d_qoy=[$6], i_item_sk=[$12], i_item_id=[$13], c=[$14], i_item_id0=[$15], literalTrue=[$16]) + HiveJoin(condition=[=($1, $12)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_customer_sk=[$2], ws_sales_price=[$3], d_date_sk=[$4], d_year=[$5], d_qoy=[$6], ca_address_sk=[$7], ca_county=[$8], ca_zip=[$9], c_customer_sk=[$10], c_current_addr_sk=[$11]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($2, $10)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_customer_sk=[$2], ws_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_bill_customer_sk=[$4], ws_sales_price=[$21]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_qoy=[$2]) + JdbcFilter(condition=[AND(=($2, 2), =($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_county=[$1], ca_zip=[$2], c_customer_sk=[$3], c_current_addr_sk=[$4]) + JdbcJoin(condition=[=($4, $0)], joinType=[inner]) + JdbcProject(ca_address_sk=[$0], ca_county=[$1], ca_zip=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_county=[$7], ca_zip=[$9]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$4]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + HiveJoin(condition=[=($1, $3)], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(i_item_sk=[$0], i_item_id=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(c=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], c=[COUNT()]) + JdbcFilter(condition=[IN($0, 2:BIGINT, 3:BIGINT, 5:BIGINT, 7:BIGINT, 11:BIGINT, 13:BIGINT, 17:BIGINT, 19:BIGINT, 23:BIGINT, 29:BIGINT)]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(i_item_id=[$0], literalTrue=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(i_item_id=[$0], literalTrue=[true]) + JdbcAggregate(group=[{1}]) + JdbcFilter(condition=[AND(IN($0, 2:BIGINT, 3:BIGINT, 5:BIGINT, 7:BIGINT, 11:BIGINT, 13:BIGINT, 17:BIGINT, 19:BIGINT, 23:BIGINT, 29:BIGINT), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query46.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query46.q.out new file mode 100644 index 000000000000..96a77205cbc8 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query46.q.out @@ -0,0 +1,43 @@ +CBO PLAN: +HiveProject(c_last_name=[$0], c_first_name=[$1], ca_city=[$2], bought_city=[$3], ss_ticket_number=[$4], amt=[$5], profit=[$6]) + HiveProject(c_last_name=[$0], c_first_name=[$1], ca_city=[$2], bought_city=[$3], ss_ticket_number=[$4], amt=[$5], profit=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], sort4=[$4], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], fetch=[100]) + JdbcProject(c_last_name=[$3], c_first_name=[$2], ca_city=[$5], bought_city=[$8], ss_ticket_number=[$6], amt=[$9], profit=[$10]) + JdbcJoin(condition=[AND(<>($5, $8), =($7, $0))], joinType=[inner]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$1], c_first_name=[$2], c_last_name=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$4], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(ca_address_sk=[$0], ca_city=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_city=[$6]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[current_addr]) + JdbcProject(ss_ticket_number=[$2], ss_customer_sk=[$0], bought_city=[$3], amt=[$4], profit=[$5]) + JdbcAggregate(group=[{1, 3, 5, 12}], agg#0=[sum($6)], agg#1=[sum($7)]) + JdbcJoin(condition=[=($3, $11)], joinType=[inner]) + JdbcJoin(condition=[=($2, $10)], joinType=[inner]) + JdbcJoin(condition=[=($4, $9)], joinType=[inner]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], ss_hdemo_sk=[$2], ss_addr_sk=[$3], ss_store_sk=[$4], ss_ticket_number=[$5], ss_coupon_amt=[$6], ss_net_profit=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($4), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_hdemo_sk=[$5], ss_addr_sk=[$6], ss_store_sk=[$7], ss_ticket_number=[$9], ss_coupon_amt=[$19], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(IN($2, 0, 6), IN($1, 1998, 1999, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_dow=[$7]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'Cedar Grove':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Highland Park':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Salem':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Union':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Wildwood':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_city=[$22]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(OR(=($1, 2), =($2, 1)), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(ca_address_sk=[$0], ca_city=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_city=[$6]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query47.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query47.q.out new file mode 100644 index 000000000000..b7873abc93ae --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query47.q.out @@ -0,0 +1,82 @@ +CBO PLAN: +HiveProject(v2.i_category=[$0], v2.d_year=[$1], v2.d_moy=[$2], v2.avg_monthly_sales=[$3], v2.sum_sales=[$4], v2.psum=[$5], v2.nsum=[$6]) + HiveSortLimit(sort0=[$7], sort1=[$2], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(i_category=[$0], d_year=[$4], d_moy=[$5], avg_monthly_sales=[$7], sum_sales=[$6], psum=[$13], nsum=[$19], (- (tok_table_or_col sum_sales) (tok_table_or_col avg_monthly_sales))1=[-($6, $7)]) + HiveJoin(condition=[AND(=($0, $15), =($1, $16), =($2, $17), =($3, $18), =($8, $20))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[AND(=($0, $9), =($1, $10), =($2, $11), =($3, $12), =($8, $14))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject((tok_table_or_col i_category)=[$0], (tok_table_or_col i_brand)=[$1], (tok_table_or_col s_store_name)=[$2], (tok_table_or_col s_company_name)=[$3], (tok_table_or_col d_year)=[$4], (tok_table_or_col d_moy)=[$5], (tok_function sum (tok_table_or_col ss_sales_price))=[$6], avg_window_0=[$7], rank_window_1=[$8]) + HiveFilter(condition=[AND(>($7, 0:DECIMAL(1, 0)), =($4, 2000), CASE(>($7, 0:DECIMAL(1, 0)), >(/(ABS(-($6, $7)), $7), 0.1:DECIMAL(1, 1)), false), IS NOT NULL($8))]) + HiveProject((tok_table_or_col i_category)=[$1], (tok_table_or_col i_brand)=[$0], (tok_table_or_col s_store_name)=[$4], (tok_table_or_col s_company_name)=[$5], (tok_table_or_col d_year)=[$2], (tok_table_or_col d_moy)=[$3], (tok_function sum (tok_table_or_col ss_sales_price))=[$6], avg_window_0=[avg($6) OVER (PARTITION BY $1, $0, $4, $5, $2 ORDER BY $1 NULLS FIRST, $0 NULLS FIRST, $4 NULLS FIRST, $5 NULLS FIRST, $2 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)], rank_window_1=[rank() OVER (PARTITION BY $1, $0, $4, $5 ORDER BY $2 NULLS LAST, $3 NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(i_brand=[$0], i_category=[$1], d_year=[$2], d_moy=[$3], s_store_name=[$4], s_company_name=[$5], $f6=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{5, 6, 8, 9, 11, 12}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($2, $10)], joinType=[inner]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_store_sk=[$2], ss_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_store_sk=[$7], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(i_item_sk=[$0], i_brand=[$1], i_category=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_brand=[$8], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(OR(=($1, 2000), AND(=($1, 1999), =($2, 12)), AND(=($1, 2001), =($2, 1))), IN($1, 1999, 2000, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0], s_store_name=[$1], s_company_name=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5], s_company_name=[$17]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject((tok_table_or_col i_category)=[$0], (tok_table_or_col i_brand)=[$1], (tok_table_or_col s_store_name)=[$2], (tok_table_or_col s_company_name)=[$3], (tok_function sum (tok_table_or_col ss_sales_price))=[$4], EXPR$0=[+($5, 1)]) + HiveFilter(condition=[IS NOT NULL($5)]) + HiveProject((tok_table_or_col i_category)=[$1], (tok_table_or_col i_brand)=[$0], (tok_table_or_col s_store_name)=[$4], (tok_table_or_col s_company_name)=[$5], (tok_function sum (tok_table_or_col ss_sales_price))=[$6], rank_window_1=[rank() OVER (PARTITION BY $1, $0, $4, $5 ORDER BY $2 NULLS LAST, $3 NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(i_brand=[$0], i_category=[$1], d_year=[$2], d_moy=[$3], s_store_name=[$4], s_company_name=[$5], $f6=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{5, 6, 8, 9, 11, 12}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($2, $10)], joinType=[inner]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_store_sk=[$2], ss_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_store_sk=[$7], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(i_item_sk=[$0], i_brand=[$1], i_category=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_brand=[$8], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(OR(=($1, 2000), AND(=($1, 1999), =($2, 12)), AND(=($1, 2001), =($2, 1))), IN($1, 1999, 2000, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0], s_store_name=[$1], s_company_name=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5], s_company_name=[$17]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject((tok_table_or_col i_category)=[$0], (tok_table_or_col i_brand)=[$1], (tok_table_or_col s_store_name)=[$2], (tok_table_or_col s_company_name)=[$3], (tok_function sum (tok_table_or_col ss_sales_price))=[$4], EXPR$0=[-($5, 1)]) + HiveFilter(condition=[IS NOT NULL($5)]) + HiveProject((tok_table_or_col i_category)=[$1], (tok_table_or_col i_brand)=[$0], (tok_table_or_col s_store_name)=[$4], (tok_table_or_col s_company_name)=[$5], (tok_function sum (tok_table_or_col ss_sales_price))=[$6], rank_window_1=[rank() OVER (PARTITION BY $1, $0, $4, $5 ORDER BY $2 NULLS LAST, $3 NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(i_brand=[$0], i_category=[$1], d_year=[$2], d_moy=[$3], s_store_name=[$4], s_company_name=[$5], $f6=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{5, 6, 8, 9, 11, 12}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($2, $10)], joinType=[inner]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_store_sk=[$2], ss_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_store_sk=[$7], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(i_item_sk=[$0], i_brand=[$1], i_category=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_brand=[$8], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(OR(=($1, 2000), AND(=($1, 1999), =($2, 12)), AND(=($1, 2001), =($2, 1))), IN($1, 1999, 2000, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0], s_store_name=[$1], s_company_name=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5], s_company_name=[$17]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query49.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query49.q.out new file mode 100644 index 000000000000..d6fb039c6b06 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query49.q.out @@ -0,0 +1,71 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$3], sort2=[$4], dir0=[ASC], dir1=[ASC], dir2=[ASC], fetch=[100]) + HiveProject(channel=[$0], item=[$1], return_ratio=[$2], return_rank=[$3], currency_rank=[$4]) + HiveAggregate(group=[{0, 1, 2, 3, 4}]) + HiveProject(channel=[$0], item=[$1], return_ratio=[$2], return_rank=[$3], currency_rank=[$4]) + HiveUnion(all=[true]) + HiveProject(channel=[$0], item=[$1], return_ratio=[$2], return_rank=[$3], currency_rank=[$4]) + HiveAggregate(group=[{0, 1, 2, 3, 4}]) + HiveProject(channel=[$0], item=[$1], return_ratio=[$2], return_rank=[$3], currency_rank=[$4]) + HiveUnion(all=[true]) + HiveProject(channel=[_UTF-16LE'web':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], item=[$0], return_ratio=[$1], return_rank=[$2], currency_rank=[$3]) + HiveFilter(condition=[OR(<=($2, 10), <=($3, 10))]) + HiveProject(item=[$0], return_ratio=[/(CAST($1):DECIMAL(15, 4), CAST($2):DECIMAL(15, 4))], rank_window_0=[rank() OVER (PARTITION BY 0 ORDER BY /(CAST($1):DECIMAL(15, 4), CAST($2):DECIMAL(15, 4)) NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)], rank_window_1=[rank() OVER (PARTITION BY 0 ORDER BY /(CAST($3):DECIMAL(15, 4), CAST($4):DECIMAL(15, 4)) NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(ws_item_sk=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{1}], agg#0=[sum($8)], agg#1=[sum($3)], agg#2=[sum($9)], agg#3=[sum($4)]) + JdbcJoin(condition=[AND(=($2, $7), =($1, $6))], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_order_number=[$2], $f2=[CASE(IS NOT NULL($3), $3, 0)], $f4=[CASE(IS NOT NULL($4), $4, 0:DECIMAL(12, 2))]) + JdbcFilter(condition=[AND(>($3, 0), >($5, 1:DECIMAL(1, 0)), >($4, 0:DECIMAL(1, 0)), IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_order_number=[$17], ws_quantity=[$18], ws_net_paid=[$29], ws_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[ws]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), =($2, 12), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(wr_item_sk=[$0], wr_order_number=[$1], $f1=[CASE(IS NOT NULL($2), $2, 0)], $f3=[CASE(IS NOT NULL($3), $3, 0:DECIMAL(12, 2))]) + JdbcFilter(condition=[AND(>($3, 10000:DECIMAL(5, 0)), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(wr_item_sk=[$2], wr_order_number=[$13], wr_return_quantity=[$14], wr_return_amt=[$15]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[wr]) + HiveProject(channel=[_UTF-16LE'catalog':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], item=[$0], return_ratio=[$1], return_rank=[$2], currency_rank=[$3]) + HiveFilter(condition=[OR(<=($2, 10), <=($3, 10))]) + HiveProject(item=[$0], return_ratio=[/(CAST($1):DECIMAL(15, 4), CAST($2):DECIMAL(15, 4))], rank_window_0=[rank() OVER (PARTITION BY 0 ORDER BY /(CAST($1):DECIMAL(15, 4), CAST($2):DECIMAL(15, 4)) NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)], rank_window_1=[rank() OVER (PARTITION BY 0 ORDER BY /(CAST($3):DECIMAL(15, 4), CAST($4):DECIMAL(15, 4)) NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(cs_item_sk=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{1}], agg#0=[sum($8)], agg#1=[sum($3)], agg#2=[sum($9)], agg#3=[sum($4)]) + JdbcJoin(condition=[AND(=($2, $7), =($1, $6))], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$1], cs_order_number=[$2], $f2=[CASE(IS NOT NULL($3), $3, 0)], $f4=[CASE(IS NOT NULL($4), $4, 0:DECIMAL(12, 2))]) + JdbcFilter(condition=[AND(>($3, 0), >($5, 1:DECIMAL(1, 0)), >($4, 0:DECIMAL(1, 0)), IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$15], cs_order_number=[$17], cs_quantity=[$18], cs_net_paid=[$29], cs_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[cs]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), =($2, 12), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(cr_item_sk=[$0], cr_order_number=[$1], $f1=[CASE(IS NOT NULL($2), $2, 0)], $f3=[CASE(IS NOT NULL($3), $3, 0:DECIMAL(12, 2))]) + JdbcFilter(condition=[AND(>($3, 10000:DECIMAL(5, 0)), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cr_item_sk=[$2], cr_order_number=[$16], cr_return_quantity=[$17], cr_return_amount=[$18]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[cr]) + HiveProject(channel=[_UTF-16LE'store':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], item=[$0], return_ratio=[$1], return_rank=[$2], currency_rank=[$3]) + HiveFilter(condition=[OR(<=($2, 10), <=($3, 10))]) + HiveProject(item=[$0], return_ratio=[/(CAST($1):DECIMAL(15, 4), CAST($2):DECIMAL(15, 4))], rank_window_0=[rank() OVER (PARTITION BY 0 ORDER BY /(CAST($1):DECIMAL(15, 4), CAST($2):DECIMAL(15, 4)) NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)], rank_window_1=[rank() OVER (PARTITION BY 0 ORDER BY /(CAST($3):DECIMAL(15, 4), CAST($4):DECIMAL(15, 4)) NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(ss_item_sk=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{1}], agg#0=[sum($8)], agg#1=[sum($3)], agg#2=[sum($9)], agg#3=[sum($4)]) + JdbcJoin(condition=[AND(=($2, $7), =($1, $6))], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_ticket_number=[$2], $f2=[CASE(IS NOT NULL($3), $3, 0)], $f4=[CASE(IS NOT NULL($4), $4, 0:DECIMAL(12, 2))]) + JdbcFilter(condition=[AND(>($3, 0), >($5, 1:DECIMAL(1, 0)), >($4, 0:DECIMAL(1, 0)), IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_ticket_number=[$9], ss_quantity=[$10], ss_net_paid=[$20], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[sts]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), =($2, 12), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(sr_item_sk=[$0], sr_ticket_number=[$1], $f1=[CASE(IS NOT NULL($2), $2, 0)], $f3=[CASE(IS NOT NULL($3), $3, 0:DECIMAL(12, 2))]) + JdbcFilter(condition=[AND(>($3, 10000:DECIMAL(5, 0)), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(sr_item_sk=[$2], sr_ticket_number=[$9], sr_return_quantity=[$10], sr_return_amt=[$11]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[sr]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query5.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query5.q.out new file mode 100644 index 000000000000..80fd17f3b0d8 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query5.q.out @@ -0,0 +1,85 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(channel=[$0], id=[$1], sales=[$2], returns=[$3], profit=[$4]) + HiveAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], agg#0=[sum($2)], agg#1=[sum($3)], agg#2=[sum($4)]) + HiveProject(channel=[$0], id=[$1], sales=[$2], returns=[$3], profit=[$4]) + HiveUnion(all=[true]) + HiveProject(channel=[_UTF-16LE'store channel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], id=[||(_UTF-16LE'store':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", $0)], sales=[$1], returns=[$3], profit=[-($2, $4)]) + HiveProject(s_store_id=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{8}], agg#0=[sum($2)], agg#1=[sum($3)], agg#2=[sum($4)], agg#3=[sum($5)]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcProject(store_sk=[$0], date_sk=[$1], sales_price=[$2], profit=[$3], return_amt=[$4], net_loss=[$5]) + JdbcUnion(all=[true]) + JdbcProject(store_sk=[$1], date_sk=[$0], sales_price=[$2], profit=[$3], return_amt=[CAST(0:DECIMAL(7, 2)):DECIMAL(7, 2)], net_loss=[CAST(0:DECIMAL(7, 2)):DECIMAL(7, 2)]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$7], ss_ext_sales_price=[$15], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(store_sk=[$1], date_sk=[$0], sales_price=[CAST(0:DECIMAL(7, 2)):DECIMAL(7, 2)], profit=[CAST(0:DECIMAL(7, 2)):DECIMAL(7, 2)], return_amt=[$2], net_loss=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(sr_returned_date_sk=[$0], sr_store_sk=[$7], sr_return_amt=[$11], sr_net_loss=[$19]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-08-04 00:00:00:TIMESTAMP(9), 1998-08-18 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject(channel=[_UTF-16LE'catalog channel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], id=[||(_UTF-16LE'catalog_page':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", $0)], sales=[$1], returns=[$3], profit=[-($2, $4)]) + HiveProject(cp_catalog_page_id=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{8}], agg#0=[sum($2)], agg#1=[sum($3)], agg#2=[sum($4)], agg#3=[sum($5)]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcProject(page_sk=[$0], date_sk=[$1], sales_price=[$2], profit=[$3], return_amt=[$4], net_loss=[$5]) + JdbcUnion(all=[true]) + JdbcProject(page_sk=[$1], date_sk=[$0], sales_price=[$2], profit=[$3], return_amt=[CAST(0:DECIMAL(7, 2)):DECIMAL(7, 2)], net_loss=[CAST(0:DECIMAL(7, 2)):DECIMAL(7, 2)]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cs_sold_date_sk=[$0], cs_catalog_page_sk=[$12], cs_ext_sales_price=[$23], cs_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(page_sk=[$1], date_sk=[$0], sales_price=[CAST(0:DECIMAL(7, 2)):DECIMAL(7, 2)], profit=[CAST(0:DECIMAL(7, 2)):DECIMAL(7, 2)], return_amt=[$2], net_loss=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cr_returned_date_sk=[$0], cr_catalog_page_sk=[$12], cr_return_amount=[$18], cr_net_loss=[$26]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-08-04 00:00:00:TIMESTAMP(9), 1998-08-18 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(cp_catalog_page_sk=[$0], cp_catalog_page_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cp_catalog_page_sk=[$0], cp_catalog_page_id=[$1]) + JdbcHiveTableScan(table=[[default, catalog_page]], table:alias=[catalog_page]) + HiveProject(channel=[_UTF-16LE'web channel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], id=[||(_UTF-16LE'web_site':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", $0)], sales=[$1], returns=[$3], profit=[-($2, $4)]) + HiveProject(web_site_id=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{8}], agg#0=[sum($2)], agg#1=[sum($3)], agg#2=[sum($4)], agg#3=[sum($5)]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcProject(wsr_web_site_sk=[$0], date_sk=[$1], sales_price=[$2], profit=[$3], return_amt=[$4], net_loss=[$5]) + JdbcUnion(all=[true]) + JdbcProject(wsr_web_site_sk=[$1], date_sk=[$0], sales_price=[$2], profit=[$3], return_amt=[CAST(0:DECIMAL(7, 2)):DECIMAL(7, 2)], net_loss=[CAST(0:DECIMAL(7, 2)):DECIMAL(7, 2)]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_web_site_sk=[$13], ws_ext_sales_price=[$23], ws_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(wsr_web_site_sk=[$6], date_sk=[$0], sales_price=[CAST(0:DECIMAL(7, 2)):DECIMAL(7, 2)], profit=[CAST(0:DECIMAL(7, 2)):DECIMAL(7, 2)], return_amt=[$3], net_loss=[$4]) + JdbcJoin(condition=[AND(=($1, $5), =($2, $7))], joinType=[inner]) + JdbcProject(wr_returned_date_sk=[$0], wr_item_sk=[$1], wr_order_number=[$2], wr_return_amt=[$3], wr_net_loss=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(wr_returned_date_sk=[$0], wr_item_sk=[$2], wr_order_number=[$13], wr_return_amt=[$15], wr_net_loss=[$23]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[web_returns]) + JdbcProject(ws_item_sk=[$0], ws_web_site_sk=[$1], ws_order_number=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ws_item_sk=[$3], ws_web_site_sk=[$13], ws_order_number=[$17]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-08-04 00:00:00:TIMESTAMP(9), 1998-08-18 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(web_site_sk=[$0], web_site_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(web_site_sk=[$0], web_site_id=[$1]) + JdbcHiveTableScan(table=[[default, web_site]], table:alias=[web_site]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query50.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query50.q.out new file mode 100644 index 000000000000..4dc4aeaa68b4 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query50.q.out @@ -0,0 +1,33 @@ +CBO PLAN: +HiveProject(s_store_name=[$0], s_company_id=[$1], s_street_number=[$2], s_street_name=[$3], s_street_type=[$4], s_suite_number=[$5], s_city=[$6], s_county=[$7], s_state=[$8], s_zip=[$9], 30 days=[$10], 31-60 days=[$11], 61-90 days=[$12], 91-120 days=[$13], >120 days=[$14]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4], $f5=[$5], $f6=[$6], $f7=[$7], $f8=[$8], $f9=[$9], $f10=[$10], $f11=[$11], $f12=[$12], $f13=[$13], $f14=[$14]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], sort4=[$4], sort5=[$5], sort6=[$6], sort7=[$7], sort8=[$8], sort9=[$9], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], dir5=[ASC], dir6=[ASC], dir7=[ASC], dir8=[ASC], dir9=[ASC], fetch=[100]) + JdbcAggregate(group=[{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}], agg#0=[sum($10)], agg#1=[sum($11)], agg#2=[sum($12)], agg#3=[sum($13)], agg#4=[sum($14)]) + JdbcProject($f0=[$12], $f1=[$13], $f2=[$14], $f3=[$15], $f4=[$16], $f5=[$17], $f6=[$18], $f7=[$19], $f8=[$20], $f9=[$21], $f10=[CASE(<=(-($6, $0), 30), 1, 0)], $f11=[CASE(AND(>(-($6, $0), 30), <=(-($6, $0), 60)), 1, 0)], $f12=[CASE(AND(>(-($6, $0), 60), <=(-($6, $0), 90)), 1, 0)], $f13=[CASE(AND(>(-($6, $0), 90), <=(-($6, $0), 120)), 1, 0)], $f14=[CASE(>(-($6, $0), 120), 1, 0)]) + JdbcJoin(condition=[=($3, $11)], joinType=[inner]) + JdbcJoin(condition=[AND(=($4, $9), =($1, $7), =($2, $8))], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2], ss_store_sk=[$3], ss_ticket_number=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($4), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_customer_sk=[$3], ss_store_sk=[$7], ss_ticket_number=[$9]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(d_date_sk=[$0]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$1], sr_customer_sk=[$2], sr_ticket_number=[$3], d_date_sk=[$4]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$1], sr_customer_sk=[$2], sr_ticket_number=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($0))]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$2], sr_customer_sk=[$3], sr_ticket_number=[$9]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), =($2, 9), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d2]) + JdbcProject(s_store_sk=[$0], s_store_name=[$1], s_company_id=[$2], s_street_number=[$3], s_street_name=[$4], s_street_type=[$5], s_suite_number=[$6], s_city=[$7], s_county=[$8], s_state=[$9], s_zip=[$10]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5], s_company_id=[$16], s_street_number=[$18], s_street_name=[$19], s_street_type=[$20], s_suite_number=[$21], s_city=[$22], s_county=[$23], s_state=[$24], s_zip=[$25]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query51.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query51.q.out new file mode 100644 index 000000000000..ee7ba7ba5e98 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query51.q.out @@ -0,0 +1,33 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(y.item_sk=[$0], y.d_date=[$1], y.web_sales=[$2], y.store_sales=[$3], y.web_cumulative=[$4], y.store_cumulative=[$5]) + HiveFilter(condition=[>($4, $5)]) + HiveProject(item_sk=[CASE(IS NOT NULL($0), $0, $3)], d_date=[CASE(IS NOT NULL($1), $1, $4)], web_sales=[$2], store_sales=[$5], max_window_0=[max($2) OVER (PARTITION BY CASE(IS NOT NULL($0), $0, $3) ORDER BY CASE(IS NOT NULL($1), $1, $4) NULLS LAST ROWS UNBOUNDED PRECEDING)], max_window_1=[max($5) OVER (PARTITION BY CASE(IS NOT NULL($0), $0, $3) ORDER BY CASE(IS NOT NULL($1), $1, $4) NULLS LAST ROWS UNBOUNDED PRECEDING)]) + HiveJoin(condition=[AND(=($0, $3), =($1, $4))], joinType=[full], algorithm=[none], cost=[not available]) + HiveProject(item_sk=[$0], d_date=[$1], cume_sales=[sum($2) OVER (PARTITION BY $0 ORDER BY $1 NULLS LAST ROWS UNBOUNDED PRECEDING)]) + HiveProject(ws_item_sk=[$0], d_date=[$1], $f2=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{1, 4}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_sales_price=[$21]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(item_sk=[$0], d_date=[$1], cume_sales=[sum($2) OVER (PARTITION BY $0 ORDER BY $1 NULLS LAST ROWS UNBOUNDED PRECEDING)]) + HiveProject(ss_item_sk=[$0], d_date=[$1], $f2=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{1, 4}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query52.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query52.q.out new file mode 100644 index 000000000000..f5869c940e80 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query52.q.out @@ -0,0 +1,22 @@ +CBO PLAN: +HiveProject(dt.d_year=[$0], brand_id=[$1], brand=[$2], ext_price=[$3]) + HiveProject(d_year=[$0], brand_id=[$1], brand=[$2], ext_price=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(d_year=[CAST(1998):INTEGER], brand_id=[$0], brand=[$1], ext_price=[$2]) + JdbcSort(sort0=[$2], sort1=[$0], dir0=[DESC], dir1=[ASC], fetch=[100]) + JdbcAggregate(group=[{5, 6}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($3, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 12), =($1, 1998), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[dt]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_brand=[$2]) + JdbcFilter(condition=[AND(=($3, 1), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_brand=[$8], i_manager_id=[$20]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query53.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query53.q.out new file mode 100644 index 000000000000..58a444205b75 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query53.q.out @@ -0,0 +1,28 @@ +CBO PLAN: +HiveSortLimit(sort0=[$2], sort1=[$1], sort2=[$0], dir0=[ASC], dir1=[ASC], dir2=[ASC], fetch=[100]) + HiveProject(tmp1.i_manufact_id=[$0], tmp1.sum_sales=[$1], tmp1.avg_quarterly_sales=[$2]) + HiveFilter(condition=[CASE(>($2, 0:DECIMAL(1, 0)), >(/(ABS(-($1, $2)), $2), 0.1:DECIMAL(1, 1)), false)]) + HiveProject((tok_table_or_col i_manufact_id)=[$0], (tok_function sum (tok_table_or_col ss_sales_price))=[$2], avg_window_0=[avg($2) OVER (PARTITION BY $0 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(i_manufact_id=[$0], d_qoy=[$1], $f2=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{6, 8}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcJoin(condition=[=($1, $5)], joinType=[inner]) + JdbcJoin(condition=[=($2, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_store_sk=[$2], ss_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_store_sk=[$7], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(i_item_sk=[$0], i_manufact_id=[$4]) + JdbcFilter(condition=[AND(OR(AND(IN($3, _UTF-16LE'Books':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Children':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Electronics':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'personal':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'portable':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'reference':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'self-help':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($1, _UTF-16LE'exportiunivamalg #9':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'scholaramalgamalg #14':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'scholaramalgamalg #7':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'scholaramalgamalg #9':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")), AND(IN($3, _UTF-16LE'Men':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Music':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Women':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'accessories':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'classical':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'fragrances':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'pants':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($1, _UTF-16LE'amalgimporto #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'edu packscholar #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'exportiimporto #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'importoamalg #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"))), IN($2, _UTF-16LE'accessories':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'classical':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'fragrances':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'pants':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'personal':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'portable':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'reference':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'self-help':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($1, _UTF-16LE'amalgimporto #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'edu packscholar #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'exportiimporto #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'exportiunivamalg #9':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'importoamalg #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'scholaramalgamalg #14':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'scholaramalgamalg #7':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'scholaramalgamalg #9':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($3, _UTF-16LE'Books':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Children':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Electronics':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Men':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Music':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Women':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_brand=[$8], i_class=[$10], i_category=[$12], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_qoy=[$2]) + JdbcFilter(condition=[AND(IN($1, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query54.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query54.q.out new file mode 100644 index 000000000000..f88b17fbb0a3 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query54.q.out @@ -0,0 +1,98 @@ +Warning: Shuffle Join MERGEJOIN[68][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product +Warning: Shuffle Join MERGEJOIN[70][tables = [$hdt$_3, $hdt$_4]] in Stage 'Reducer 12' is a cross product +Warning: Shuffle Join MERGEJOIN[71][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3]] in Stage 'Reducer 4' is a cross product +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(segment=[$0], num_customers=[$1], segment_base=[*($0, 50)]) + HiveAggregate(group=[{0}], agg#0=[count()]) + HiveProject($f0=[CAST(/($1, 50:DECIMAL(10, 0))):INTEGER]) + HiveAggregate(group=[{14}], agg#0=[sum($6)]) + HiveJoin(condition=[=($14, $5)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[<=($1, $8)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($4, $0)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(d_date_sk=[$0], d_month_seq=[$1], $f0=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[<=($2, $1)], joinType=[inner]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcAggregate(group=[{0}]) + JdbcProject($f0=[+($0, 1)]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 3), IS NOT NULL($0))]) + JdbcProject(d_month_seq=[$3], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(cnt=[$0]) + HiveFilter(condition=[sq_count_check($0)]) + HiveProject(cnt=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], cnt=[COUNT()]) + JdbcAggregate(group=[{0}]) + JdbcProject($f0=[+($0, 3)]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 3))]) + JdbcProject(d_month_seq=[$3], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], ss_ext_sales_price=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(cnt=[$0], $f0=[$1]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(cnt=[$0]) + HiveFilter(condition=[sq_count_check($0)]) + HiveProject(cnt=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], cnt=[COUNT()]) + JdbcAggregate(group=[{0}]) + JdbcProject($f0=[+($0, 1)]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 3))]) + JdbcProject(d_month_seq=[$3], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{0}]) + JdbcProject($f0=[+($0, 3)]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 3), IS NOT NULL($0))]) + JdbcProject(d_month_seq=[$3], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(ca_address_sk=[$0], ca_county=[$1], ca_state=[$2], s_county=[$3], s_state=[$4], c_customer_sk=[$5], c_current_addr_sk=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($6, $0)], joinType=[inner]) + JdbcJoin(condition=[AND(=($1, $3), =($2, $4))], joinType=[inner]) + JdbcProject(ca_address_sk=[$0], ca_county=[$1], ca_state=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(ca_address_sk=[$0], ca_county=[$7], ca_state=[$8]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(s_county=[$0], s_state=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(s_county=[$23], s_state=[$24]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcAggregate(group=[{5, 6}]) + JdbcJoin(condition=[=($5, $1)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($2, $3)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2]) + JdbcUnion(all=[true]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], cs_item_sk=[$15]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(sold_date_sk=[$0], customer_sk=[$2], item_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_bill_customer_sk=[$4]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(i_item_sk=[$0]) + JdbcFilter(condition=[AND(=($2, _UTF-16LE'Jewelry'), =($1, _UTF-16LE'consignment'), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_class=[$10], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 3), =($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$4]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query55.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query55.q.out new file mode 100644 index 000000000000..0a9703eb9a92 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query55.q.out @@ -0,0 +1,23 @@ +CBO PLAN: +HiveProject(brand_id=[$0], brand=[$1], ext_price=[$2]) + HiveProject(brand_id=[$0], brand=[$1], ext_price=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(brand_id=[$0], brand=[$1], ext_price=[$2]) + JdbcSort(sort0=[$2], sort1=[$3], dir0=[DESC], dir1=[ASC], fetch=[100]) + JdbcProject(brand_id=[$0], brand=[$1], ext_price=[$2], (tok_table_or_col i_brand_id)=[$0]) + JdbcAggregate(group=[{5, 6}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($3, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 12), =($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_brand=[$2]) + JdbcFilter(condition=[AND(=($3, 36), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_brand=[$8], i_manager_id=[$20]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query56.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query56.q.out new file mode 100644 index 000000000000..7d14896d09cf --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query56.q.out @@ -0,0 +1,100 @@ +CBO PLAN: +HiveSortLimit(sort0=[$1], dir0=[ASC], fetch=[100]) + HiveProject(i_item_id=[$0], total_sales=[$1]) + HiveAggregate(group=[{0}], agg#0=[sum($1)]) + HiveProject(i_item_id=[$0], $f1=[$1]) + HiveUnion(all=[true]) + HiveProject(i_item_id=[$0], $f1=[$1]) + HiveAggregate(group=[{10}], agg#0=[sum($3)]) + HiveSemiJoin(condition=[=($10, $11)], joinType=[semi]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_addr_sk=[$2], ss_ext_sales_price=[$3], d_date_sk=[$4], d_year=[$5], d_moy=[$6], ca_address_sk=[$7], ca_gmt_offset=[$8], i_item_sk=[$9], i_item_id=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_addr_sk=[$2], ss_ext_sales_price=[$3], d_date_sk=[$8], d_year=[$9], d_moy=[$10], ca_address_sk=[$4], ca_gmt_offset=[$5], i_item_sk=[$6], i_item_id=[$7]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcJoin(condition=[=($2, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_addr_sk=[$2], ss_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_addr_sk=[$6], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$1]) + JdbcFilter(condition=[AND(=($1, -8:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$11]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 2000), =($2, 1), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(i_item_id=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(i_item_id=[$0]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'chiffon':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'lace':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'orchid':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(i_item_id=[$1], i_color=[$17]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(i_item_id=[$0], $f1=[$1]) + HiveAggregate(group=[{10}], agg#0=[sum($3)]) + HiveSemiJoin(condition=[=($10, $11)], joinType=[semi]) + HiveProject(cs_sold_date_sk=[$0], cs_bill_addr_sk=[$1], cs_item_sk=[$2], cs_ext_sales_price=[$3], d_date_sk=[$4], d_year=[$5], d_moy=[$6], ca_address_sk=[$7], ca_gmt_offset=[$8], i_item_sk=[$9], i_item_id=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_addr_sk=[$1], cs_item_sk=[$2], cs_ext_sales_price=[$3], d_date_sk=[$8], d_year=[$9], d_moy=[$10], ca_address_sk=[$4], ca_gmt_offset=[$5], i_item_sk=[$6], i_item_id=[$7]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcJoin(condition=[=($2, $6)], joinType=[inner]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_addr_sk=[$1], cs_item_sk=[$2], cs_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_addr_sk=[$6], cs_item_sk=[$15], cs_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$1]) + JdbcFilter(condition=[AND(=($1, -8:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$11]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 2000), =($2, 1), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(i_item_id=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(i_item_id=[$0]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'chiffon':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'lace':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'orchid':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(i_item_id=[$1], i_color=[$17]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(i_item_id=[$0], $f1=[$1]) + HiveAggregate(group=[{10}], agg#0=[sum($3)]) + HiveSemiJoin(condition=[=($10, $11)], joinType=[semi]) + HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_addr_sk=[$2], ws_ext_sales_price=[$3], d_date_sk=[$4], d_year=[$5], d_moy=[$6], ca_address_sk=[$7], ca_gmt_offset=[$8], i_item_sk=[$9], i_item_id=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_addr_sk=[$2], ws_ext_sales_price=[$3], d_date_sk=[$8], d_year=[$9], d_moy=[$10], ca_address_sk=[$4], ca_gmt_offset=[$5], i_item_sk=[$6], i_item_id=[$7]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcJoin(condition=[=($2, $4)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_addr_sk=[$2], ws_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_bill_addr_sk=[$7], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$1]) + JdbcFilter(condition=[AND(=($1, -8:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$11]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 2000), =($2, 1), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(i_item_id=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(i_item_id=[$0]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'chiffon':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'lace':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'orchid':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(i_item_id=[$1], i_color=[$17]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query57.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query57.q.out new file mode 100644 index 000000000000..952e63cd6907 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query57.q.out @@ -0,0 +1,82 @@ +CBO PLAN: +HiveProject(v2.i_category=[$0], v2.i_brand=[$1], v2.d_year=[$2], v2.d_moy=[$3], v2.avg_monthly_sales=[$4], v2.sum_sales=[$5], v2.psum=[$6], v2.nsum=[$7]) + HiveSortLimit(sort0=[$8], sort1=[$2], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(i_category=[$0], i_brand=[$1], d_year=[$3], d_moy=[$4], avg_monthly_sales=[$6], sum_sales=[$5], psum=[$11], nsum=[$16], (- (tok_table_or_col sum_sales) (tok_table_or_col avg_monthly_sales))1=[-($5, $6)]) + HiveJoin(condition=[AND(=($0, $13), =($1, $14), =($7, $17), =($2, $15))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[AND(=($0, $8), =($1, $9), =($7, $12), =($2, $10))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject((tok_table_or_col i_category)=[$0], (tok_table_or_col i_brand)=[$1], (tok_table_or_col cc_name)=[$2], (tok_table_or_col d_year)=[$3], (tok_table_or_col d_moy)=[$4], (tok_function sum (tok_table_or_col cs_sales_price))=[$5], avg_window_0=[$6], rank_window_1=[$7]) + HiveFilter(condition=[AND(>($6, 0:DECIMAL(1, 0)), =($3, 2000), CASE(>($6, 0:DECIMAL(1, 0)), >(/(ABS(-($5, $6)), $6), 0.1:DECIMAL(1, 1)), false), IS NOT NULL($7))]) + HiveProject((tok_table_or_col i_category)=[$2], (tok_table_or_col i_brand)=[$1], (tok_table_or_col cc_name)=[$0], (tok_table_or_col d_year)=[$3], (tok_table_or_col d_moy)=[$4], (tok_function sum (tok_table_or_col cs_sales_price))=[$5], avg_window_0=[avg($5) OVER (PARTITION BY $2, $1, $0, $3 ORDER BY $2 NULLS FIRST, $1 NULLS FIRST, $0 NULLS FIRST, $3 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)], rank_window_1=[rank() OVER (PARTITION BY $2, $1, $0 ORDER BY $3 NULLS LAST, $4 NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(cc_name=[$0], i_brand=[$1], i_category=[$2], d_year=[$3], d_moy=[$4], $f5=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{5, 7, 8, 10, 11}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcJoin(condition=[=($2, $6)], joinType=[inner]) + JdbcJoin(condition=[=($4, $1)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_call_center_sk=[$1], cs_item_sk=[$2], cs_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cs_sold_date_sk=[$0], cs_call_center_sk=[$11], cs_item_sk=[$15], cs_sales_price=[$21]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(cc_call_center_sk=[$0], cc_name=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cc_call_center_sk=[$0], cc_name=[$6]) + JdbcHiveTableScan(table=[[default, call_center]], table:alias=[call_center]) + JdbcProject(i_item_sk=[$0], i_brand=[$1], i_category=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_brand=[$8], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(OR(=($1, 2000), AND(=($1, 1999), =($2, 12)), AND(=($1, 2001), =($2, 1))), IN($1, 1999, 2000, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject((tok_table_or_col i_category)=[$0], (tok_table_or_col i_brand)=[$1], (tok_table_or_col cc_name)=[$2], (tok_function sum (tok_table_or_col cs_sales_price))=[$3], EXPR$0=[+($4, 1)]) + HiveFilter(condition=[IS NOT NULL($4)]) + HiveProject((tok_table_or_col i_category)=[$2], (tok_table_or_col i_brand)=[$1], (tok_table_or_col cc_name)=[$0], (tok_function sum (tok_table_or_col cs_sales_price))=[$5], rank_window_1=[rank() OVER (PARTITION BY $2, $1, $0 ORDER BY $3 NULLS LAST, $4 NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(cc_name=[$0], i_brand=[$1], i_category=[$2], d_year=[$3], d_moy=[$4], $f5=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{5, 7, 8, 10, 11}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcJoin(condition=[=($2, $6)], joinType=[inner]) + JdbcJoin(condition=[=($4, $1)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_call_center_sk=[$1], cs_item_sk=[$2], cs_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cs_sold_date_sk=[$0], cs_call_center_sk=[$11], cs_item_sk=[$15], cs_sales_price=[$21]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(cc_call_center_sk=[$0], cc_name=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cc_call_center_sk=[$0], cc_name=[$6]) + JdbcHiveTableScan(table=[[default, call_center]], table:alias=[call_center]) + JdbcProject(i_item_sk=[$0], i_brand=[$1], i_category=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_brand=[$8], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(OR(=($1, 2000), AND(=($1, 1999), =($2, 12)), AND(=($1, 2001), =($2, 1))), IN($1, 1999, 2000, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject((tok_table_or_col i_category)=[$0], (tok_table_or_col i_brand)=[$1], (tok_table_or_col cc_name)=[$2], (tok_function sum (tok_table_or_col cs_sales_price))=[$3], EXPR$0=[-($4, 1)]) + HiveFilter(condition=[IS NOT NULL($4)]) + HiveProject((tok_table_or_col i_category)=[$2], (tok_table_or_col i_brand)=[$1], (tok_table_or_col cc_name)=[$0], (tok_function sum (tok_table_or_col cs_sales_price))=[$5], rank_window_1=[rank() OVER (PARTITION BY $2, $1, $0 ORDER BY $3 NULLS LAST, $4 NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(cc_name=[$0], i_brand=[$1], i_category=[$2], d_year=[$3], d_moy=[$4], $f5=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{5, 7, 8, 10, 11}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcJoin(condition=[=($2, $6)], joinType=[inner]) + JdbcJoin(condition=[=($4, $1)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_call_center_sk=[$1], cs_item_sk=[$2], cs_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cs_sold_date_sk=[$0], cs_call_center_sk=[$11], cs_item_sk=[$15], cs_sales_price=[$21]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(cc_call_center_sk=[$0], cc_name=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cc_call_center_sk=[$0], cc_name=[$6]) + JdbcHiveTableScan(table=[[default, call_center]], table:alias=[call_center]) + JdbcProject(i_item_sk=[$0], i_brand=[$1], i_category=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_brand=[$8], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(OR(=($1, 2000), AND(=($1, 1999), =($2, 12)), AND(=($1, 2001), =($2, 1))), IN($1, 1999, 2000, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query58.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query58.q.out new file mode 100644 index 000000000000..94b4ad5f8ab9 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query58.q.out @@ -0,0 +1,139 @@ +Warning: Shuffle Join MERGEJOIN[120][tables = [$hdt$_1, $hdt$_2]] in Stage 'Reducer 8' is a cross product +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(ss_items.item_id=[$0], ss_item_rev=[$1], ss_dev=[*(/(/($1, +(+($1, $5), $9)), 3:DECIMAL(10, 0)), 100:DECIMAL(10, 0))], cs_item_rev=[$5], cs_dev=[*(/(/($5, +(+($1, $5), $9)), 3:DECIMAL(10, 0)), 100:DECIMAL(10, 0))], ws_item_rev=[$9], ws_dev=[*(/(/($9, +(+($1, $5), $9)), 3:DECIMAL(10, 0)), 100:DECIMAL(10, 0))], average=[/(+(+($1, $5), $9), 3:DECIMAL(10, 0))]) + HiveJoin(condition=[AND(=($0, $8), BETWEEN(false, $1, $10, $11), BETWEEN(false, $5, $10, $11), BETWEEN(false, $9, $2, $3), BETWEEN(false, $9, $6, $7))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[AND(=($0, $4), BETWEEN(false, $1, $6, $7), BETWEEN(false, $5, $2, $3))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject($f0=[$0], $f1=[$1], EXPR$1=[*(0.9:DECIMAL(1, 1), $1)], EXPR$2=[*(1.1:DECIMAL(2, 1), $1)]) + HiveAggregate(group=[{4}], agg#0=[sum($2)]) + HiveSemiJoin(condition=[=($6, $7)], joinType=[semi]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_ext_sales_price=[$2], i_item_sk=[$3], i_item_id=[$4], d_date_sk=[$5], d_date=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(d_date=[$0]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(d_date=[$0], d_week_seq=[$1], d_week_seq0=[$2]) + HiveProject(d_date=[$0], d_week_seq=[$1], d_week_seq0=[$2]) + HiveProject(d_date=[$0], d_week_seq=[$1], d_week_seq0=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($1, $2)], joinType=[inner]) + JdbcProject(d_date=[$0], d_week_seq=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(d_date=[$2], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(d_week_seq=[$1]) + JdbcFilter(condition=[AND(=($0, _UTF-16LE'1998-02-19'), IS NOT NULL($1))]) + JdbcProject(d_date=[$2], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(cnt=[$0]) + HiveFilter(condition=[sq_count_check($0)]) + HiveProject(cnt=[$0]) + HiveProject(cnt=[$0]) + HiveProject(cnt=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], cnt=[COUNT()]) + JdbcFilter(condition=[=($0, _UTF-16LE'1998-02-19')]) + JdbcProject(d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject($f0=[$0], $f1=[$1], EXPR$3=[*(0.9:DECIMAL(1, 1), $1)], EXPR$4=[*(1.1:DECIMAL(2, 1), $1)]) + HiveAggregate(group=[{4}], agg#0=[sum($2)]) + HiveSemiJoin(condition=[=($6, $7)], joinType=[semi]) + HiveProject(cs_sold_date_sk=[$0], cs_item_sk=[$1], cs_ext_sales_price=[$2], i_item_sk=[$3], i_item_id=[$4], d_date_sk=[$5], d_date=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$1], cs_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$15], cs_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(d_date=[$0]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(d_date=[$0], d_week_seq=[$1], d_week_seq0=[$2]) + HiveProject(d_date=[$0], d_week_seq=[$1], d_week_seq0=[$2]) + HiveProject(d_date=[$0], d_week_seq=[$1], d_week_seq0=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($1, $2)], joinType=[inner]) + JdbcProject(d_date=[$0], d_week_seq=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(d_date=[$2], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(d_week_seq=[$1]) + JdbcFilter(condition=[AND(=($0, _UTF-16LE'1998-02-19'), IS NOT NULL($1))]) + JdbcProject(d_date=[$2], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(cnt=[$0]) + HiveFilter(condition=[sq_count_check($0)]) + HiveProject(cnt=[$0]) + HiveProject(cnt=[$0]) + HiveProject(cnt=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], cnt=[COUNT()]) + JdbcFilter(condition=[=($0, _UTF-16LE'1998-02-19')]) + JdbcProject(d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject($f0=[$0], $f1=[$1], EXPR$0=[*(0.9:DECIMAL(1, 1), $1)], EXPR$1=[*(1.1:DECIMAL(2, 1), $1)]) + HiveAggregate(group=[{4}], agg#0=[sum($2)]) + HiveSemiJoin(condition=[=($6, $7)], joinType=[semi]) + HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_ext_sales_price=[$2], i_item_sk=[$3], i_item_id=[$4], d_date_sk=[$5], d_date=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(d_date=[$0]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(d_date=[$0], d_week_seq=[$1], d_week_seq0=[$2]) + HiveProject(d_date=[$0], d_week_seq=[$1], d_week_seq0=[$2]) + HiveProject(d_date=[$0], d_week_seq=[$1], d_week_seq0=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($1, $2)], joinType=[inner]) + JdbcProject(d_date=[$0], d_week_seq=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(d_date=[$2], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(d_week_seq=[$1]) + JdbcFilter(condition=[AND(=($0, _UTF-16LE'1998-02-19'), IS NOT NULL($1))]) + JdbcProject(d_date=[$2], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(cnt=[$0]) + HiveFilter(condition=[sq_count_check($0)]) + HiveProject(cnt=[$0]) + HiveProject(cnt=[$0]) + HiveProject(cnt=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], cnt=[COUNT()]) + JdbcFilter(condition=[=($0, _UTF-16LE'1998-02-19')]) + JdbcProject(d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query59.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query59.q.out new file mode 100644 index 000000000000..bb6d1d8406a5 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query59.q.out @@ -0,0 +1,52 @@ +CBO PLAN: +HiveProject(s_store_name1=[$0], s_store_id1=[$1], d_week_seq1=[$2], _c3=[$3], _c4=[$4], _c5=[$5], _c6=[$6], _c7=[$7], _c8=[$8], _c9=[$9]) + HiveProject(s_store_name1=[$0], s_store_id1=[$1], d_week_seq1=[$2], _o__c3=[$3], _o__c4=[$4], _o__c5=[$5], _o__c6=[$6], _o__c7=[$7], _o__c8=[$8], _o__c9=[$9]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], dir0=[ASC], dir1=[ASC], dir2=[ASC], fetch=[100]) + JdbcProject(s_store_name1=[$12], s_store_id1=[$11], d_week_seq1=[$0], _o__c3=[/($2, $17)], _o__c4=[/($3, $18)], _o__c5=[/($4, $4)], _o__c6=[/($5, $19)], _o__c7=[/($6, $20)], _o__c8=[/($7, $21)], _o__c9=[/($8, $22)]) + JdbcJoin(condition=[AND(=($0, -($15, 52)), =($16, $13))], joinType=[inner]) + JdbcJoin(condition=[=($1, $10)], joinType=[inner]) + JdbcJoin(condition=[=($9, $0)], joinType=[inner]) + JdbcAggregate(group=[{0, 1}], agg#0=[sum($2)], agg#1=[sum($3)], agg#2=[sum($4)], agg#3=[sum($5)], agg#4=[sum($6)], agg#5=[sum($7)], agg#6=[sum($8)]) + JdbcProject($f0=[$1], $f1=[$10], $f2=[CASE($2, $11, null:DECIMAL(7, 2))], $f3=[CASE($3, $11, null:DECIMAL(7, 2))], $f4=[CASE($4, $11, null:DECIMAL(7, 2))], $f5=[CASE($5, $11, null:DECIMAL(7, 2))], $f6=[CASE($6, $11, null:DECIMAL(7, 2))], $f7=[CASE($7, $11, null:DECIMAL(7, 2))], $f8=[CASE($8, $11, null:DECIMAL(7, 2))]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(d_date_sk=[$0], d_week_seq=[$1], EXPR$0=[=($2, _UTF-16LE'Sunday')], EXPR$1=[=($2, _UTF-16LE'Monday')], EXPR$2=[=($2, _UTF-16LE'Tuesday')], EXPR$3=[=($2, _UTF-16LE'Wednesday')], EXPR$4=[=($2, _UTF-16LE'Thursday')], EXPR$5=[=($2, _UTF-16LE'Friday')], EXPR$6=[=($2, _UTF-16LE'Saturday')]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(d_date_sk=[$0], d_week_seq=[$4], d_day_name=[$14]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$1], ss_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$7], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_week_seq=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $0, 1185, 1196), IS NOT NULL($1))]) + JdbcProject(d_month_seq=[$3], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1], s_store_name=[$2], s_store_sk0=[$3], s_store_id0=[$4]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1], s_store_name=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4], $f5=[$5], $f6=[$6], $f7=[$7], d_week_seq=[$8]) + JdbcJoin(condition=[=($8, $0)], joinType=[inner]) + JdbcAggregate(group=[{0, 1}], agg#0=[sum($2)], agg#1=[sum($3)], agg#2=[sum($5)], agg#3=[sum($6)], agg#4=[sum($7)], agg#5=[sum($8)]) + JdbcProject($f0=[$1], $f1=[$10], $f2=[CASE($2, $11, null:DECIMAL(7, 2))], $f3=[CASE($3, $11, null:DECIMAL(7, 2))], $f4=[CASE($4, $11, null:DECIMAL(7, 2))], $f5=[CASE($5, $11, null:DECIMAL(7, 2))], $f6=[CASE($6, $11, null:DECIMAL(7, 2))], $f7=[CASE($7, $11, null:DECIMAL(7, 2))], $f8=[CASE($8, $11, null:DECIMAL(7, 2))]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(d_date_sk=[$0], d_week_seq=[$1], EXPR$0=[=($2, _UTF-16LE'Sunday')], EXPR$1=[=($2, _UTF-16LE'Monday')], EXPR$2=[=($2, _UTF-16LE'Tuesday')], EXPR$3=[=($2, _UTF-16LE'Wednesday')], EXPR$4=[=($2, _UTF-16LE'Thursday')], EXPR$5=[=($2, _UTF-16LE'Friday')], EXPR$6=[=($2, _UTF-16LE'Saturday')]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(d_date_sk=[$0], d_week_seq=[$4], d_day_name=[$14]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$1], ss_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$7], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_week_seq=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $0, 1197, 1208), IS NOT NULL($1))]) + JdbcProject(d_month_seq=[$3], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query6.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query6.q.out new file mode 100644 index 000000000000..4c5d3a27c380 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query6.q.out @@ -0,0 +1,60 @@ +Warning: Map Join MAPJOIN[51][bigTable=?] in task 'Map 2' is a cross product +CBO PLAN: +HiveSortLimit(sort0=[$1], dir0=[ASC], fetch=[100]) + HiveProject(state=[$0], cnt=[$1]) + HiveFilter(condition=[>=($1, 10)]) + HiveAggregate(group=[{13}], agg#0=[count()]) + HiveJoin(condition=[=($14, $6)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($5, $7)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($4, $0)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(d_date_sk=[$0], d_month_seq=[$1], d_month_seq0=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($1, $2)], joinType=[inner]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d]) + JdbcAggregate(group=[{0}]) + JdbcFilter(condition=[AND(=($1, 2000), =($2, 2), IS NOT NULL($0))]) + JdbcProject(d_month_seq=[$3], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(cnt=[$0]) + HiveFilter(condition=[sq_count_check($0)]) + HiveProject(cnt=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], cnt=[COUNT()]) + JdbcAggregate(group=[{0}]) + JdbcFilter(condition=[AND(=($1, 2000), =($2, 2))]) + JdbcProject(d_month_seq=[$3], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_customer_sk=[$3]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[s]) + HiveProject(i_item_sk=[$0], i_current_price=[$1], i_category=[$2], i_category0=[$3], EXPR$0=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[AND(=($3, $2), >($1, $4))], joinType=[inner]) + JdbcProject(i_item_sk=[$0], i_current_price=[$1], i_category=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_current_price=[$5], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[i]) + JdbcProject(i_category=[$0], EXPR$0=[*(1.2:DECIMAL(2, 1), CAST(CAST(/($1, $2)):DECIMAL(11, 6)):DECIMAL(16, 6))]) + JdbcFilter(condition=[IS NOT NULL(CAST(CAST(/($1, $2)):DECIMAL(11, 6)):DECIMAL(16, 6))]) + JdbcAggregate(group=[{1}], agg#0=[sum($0)], agg#1=[count($0)]) + JdbcFilter(condition=[IS NOT NULL($1)]) + JdbcProject(i_current_price=[$5], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[j]) + HiveProject(ca_address_sk=[$0], ca_state=[$1], c_customer_sk=[$2], c_current_addr_sk=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ca_address_sk=[$0], ca_state=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[a]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$4]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[c]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query60.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query60.q.out new file mode 100644 index 000000000000..525de7c23600 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query60.q.out @@ -0,0 +1,100 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(i_item_id=[$0], total_sales=[$1]) + HiveAggregate(group=[{0}], agg#0=[sum($1)]) + HiveProject(i_item_id=[$0], $f1=[$1]) + HiveUnion(all=[true]) + HiveProject(i_item_id=[$0], $f1=[$1]) + HiveAggregate(group=[{10}], agg#0=[sum($3)]) + HiveSemiJoin(condition=[=($10, $11)], joinType=[semi]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_addr_sk=[$2], ss_ext_sales_price=[$3], d_date_sk=[$4], d_year=[$5], d_moy=[$6], ca_address_sk=[$7], ca_gmt_offset=[$8], i_item_sk=[$9], i_item_id=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_addr_sk=[$2], ss_ext_sales_price=[$3], d_date_sk=[$8], d_year=[$9], d_moy=[$10], ca_address_sk=[$4], ca_gmt_offset=[$5], i_item_sk=[$6], i_item_id=[$7]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcJoin(condition=[=($2, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_addr_sk=[$2], ss_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_addr_sk=[$6], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$1]) + JdbcFilter(condition=[AND(=($1, -6:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$11]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 9), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(i_item_id=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(i_item_id=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'Children'), IS NOT NULL($0))]) + JdbcProject(i_item_id=[$1], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(i_item_id=[$0], $f1=[$1]) + HiveAggregate(group=[{10}], agg#0=[sum($3)]) + HiveSemiJoin(condition=[=($10, $11)], joinType=[semi]) + HiveProject(cs_sold_date_sk=[$0], cs_bill_addr_sk=[$1], cs_item_sk=[$2], cs_ext_sales_price=[$3], d_date_sk=[$4], d_year=[$5], d_moy=[$6], ca_address_sk=[$7], ca_gmt_offset=[$8], i_item_sk=[$9], i_item_id=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_addr_sk=[$1], cs_item_sk=[$2], cs_ext_sales_price=[$3], d_date_sk=[$8], d_year=[$9], d_moy=[$10], ca_address_sk=[$4], ca_gmt_offset=[$5], i_item_sk=[$6], i_item_id=[$7]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcJoin(condition=[=($2, $6)], joinType=[inner]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_addr_sk=[$1], cs_item_sk=[$2], cs_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_addr_sk=[$6], cs_item_sk=[$15], cs_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$1]) + JdbcFilter(condition=[AND(=($1, -6:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$11]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 9), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(i_item_id=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(i_item_id=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'Children'), IS NOT NULL($0))]) + JdbcProject(i_item_id=[$1], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(i_item_id=[$0], $f1=[$1]) + HiveAggregate(group=[{10}], agg#0=[sum($3)]) + HiveSemiJoin(condition=[=($10, $11)], joinType=[semi]) + HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_addr_sk=[$2], ws_ext_sales_price=[$3], d_date_sk=[$4], d_year=[$5], d_moy=[$6], ca_address_sk=[$7], ca_gmt_offset=[$8], i_item_sk=[$9], i_item_id=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_addr_sk=[$2], ws_ext_sales_price=[$3], d_date_sk=[$8], d_year=[$9], d_moy=[$10], ca_address_sk=[$4], ca_gmt_offset=[$5], i_item_sk=[$6], i_item_id=[$7]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcJoin(condition=[=($2, $4)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_addr_sk=[$2], ws_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_bill_addr_sk=[$7], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$1]) + JdbcFilter(condition=[AND(=($1, -6:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$11]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 9), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(i_item_id=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(i_item_id=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'Children'), IS NOT NULL($0))]) + JdbcProject(i_item_id=[$1], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query61.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query61.q.out new file mode 100644 index 000000000000..82a11202fa1b --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query61.q.out @@ -0,0 +1,76 @@ +Warning: Shuffle Join MERGEJOIN[9][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product +CBO PLAN: +HiveProject(promotions=[$0], total=[$1], _c2=[*(/(CAST($0):DECIMAL(15, 4), CAST($1):DECIMAL(15, 4)), 100:DECIMAL(10, 0))]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[sum($5)]) + JdbcJoin(condition=[=($2, $10)], joinType=[inner]) + JdbcJoin(condition=[=($1, $9)], joinType=[inner]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcJoin(condition=[=($4, $7)], joinType=[inner]) + JdbcJoin(condition=[=($3, $6)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2], ss_store_sk=[$3], ss_promo_sk=[$4], ss_ext_sales_price=[$5]) + JdbcFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($4), IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_customer_sk=[$3], ss_store_sk=[$7], ss_promo_sk=[$8], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(=($1, -7:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_gmt_offset=[$27]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(p_promo_sk=[$0]) + JdbcFilter(condition=[AND(OR(=($1, _UTF-16LE'Y'), =($2, _UTF-16LE'Y'), =($3, _UTF-16LE'Y')), IS NOT NULL($0))]) + JdbcProject(p_promo_sk=[$0], p_channel_dmail=[$8], p_channel_email=[$9], p_channel_tv=[$11]) + JdbcHiveTableScan(table=[[default, promotion]], table:alias=[promotion]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 11), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'Electronics'), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$1], ca_address_sk=[$2]) + JdbcJoin(condition=[=($2, $1)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$4]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(ca_address_sk=[$0]) + JdbcFilter(condition=[AND(=($1, -7:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$11]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[sum($4)]) + JdbcJoin(condition=[=($2, $8)], joinType=[inner]) + JdbcJoin(condition=[=($1, $7)], joinType=[inner]) + JdbcJoin(condition=[=($0, $6)], joinType=[inner]) + JdbcJoin(condition=[=($3, $5)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2], ss_store_sk=[$3], ss_ext_sales_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_customer_sk=[$3], ss_store_sk=[$7], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(=($1, -7:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_gmt_offset=[$27]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 11), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'Electronics'), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$1], ca_address_sk=[$2]) + JdbcJoin(condition=[=($2, $1)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$4]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(ca_address_sk=[$0]) + JdbcFilter(condition=[AND(=($1, -7:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$11]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query62.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query62.q.out new file mode 100644 index 000000000000..1eefe8d41393 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query62.q.out @@ -0,0 +1,36 @@ +CBO PLAN: +HiveProject(_c0=[$0], sm_type=[$1], web_name=[$2], 30 days=[$3], 31-60 days=[$4], 61-90 days=[$5], 91-120 days=[$6], >120 days=[$7]) + HiveSortLimit(sort0=[$8], sort1=[$1], sort2=[$2], dir0=[ASC], dir1=[ASC], dir2=[ASC], fetch=[100]) + HiveProject(_o__c0=[$0], sm_type=[$1], web_name=[$2], 30 days=[$3], 31-60 days=[$4], 61-90 days=[$5], 91-120 days=[$6], >120 days=[$7], (tok_function substr (tok_table_or_col w_warehouse_name) 1 20)=[$0]) + HiveAggregate(group=[{11, 13, 15}], agg#0=[sum($4)], agg#1=[sum($5)], agg#2=[sum($6)], agg#3=[sum($7)], agg#4=[sum($8)]) + HiveJoin(condition=[=($1, $14)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($2, $12)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($3, $10)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ws_ship_date_sk=[$0], ws_web_site_sk=[$1], ws_ship_mode_sk=[$2], ws_warehouse_sk=[$3], $f3=[$4], $f4=[$5], $f5=[$6], $f6=[$7], $f7=[$8], d_date_sk=[$9]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(ws_ship_date_sk=[$1], ws_web_site_sk=[$2], ws_ship_mode_sk=[$3], ws_warehouse_sk=[$4], $f3=[CASE(<=(-($1, $0), 30), 1, 0)], $f4=[CASE(AND(>(-($1, $0), 30), <=(-($1, $0), 60)), 1, 0)], $f5=[CASE(AND(>(-($1, $0), 60), <=(-($1, $0), 90)), 1, 0)], $f6=[CASE(AND(>(-($1, $0), 90), <=(-($1, $0), 120)), 1, 0)], $f7=[CASE(>(-($1, $0), 120), 1, 0)]) + JdbcFilter(condition=[AND(IS NOT NULL($4), IS NOT NULL($3), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_ship_date_sk=[$2], ws_web_site_sk=[$13], ws_ship_mode_sk=[$14], ws_warehouse_sk=[$15]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1215, 1226), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(w_warehouse_sk=[$0], $f0=[substr($1, 1, 20)]) + HiveProject(w_warehouse_sk=[$0], w_warehouse_name=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$2]) + JdbcHiveTableScan(table=[[default, warehouse]], table:alias=[warehouse]) + HiveProject(sm_ship_mode_sk=[$0], sm_type=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(sm_ship_mode_sk=[$0], sm_type=[$2]) + JdbcHiveTableScan(table=[[default, ship_mode]], table:alias=[ship_mode]) + HiveProject(web_site_sk=[$0], web_name=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(web_site_sk=[$0], web_name=[$4]) + JdbcHiveTableScan(table=[[default, web_site]], table:alias=[web_site]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query63.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query63.q.out new file mode 100644 index 000000000000..b480c3be3571 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query63.q.out @@ -0,0 +1,28 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$2], sort2=[$1], dir0=[ASC], dir1=[ASC], dir2=[ASC], fetch=[100]) + HiveProject(tmp1.i_manager_id=[$0], tmp1.sum_sales=[$1], tmp1.avg_monthly_sales=[$2]) + HiveFilter(condition=[CASE(>($2, 0:DECIMAL(1, 0)), >(/(ABS(-($1, $2)), $2), 0.1:DECIMAL(1, 1)), false)]) + HiveProject((tok_table_or_col i_manager_id)=[$0], (tok_function sum (tok_table_or_col ss_sales_price))=[$2], avg_window_0=[avg($2) OVER (PARTITION BY $0 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(i_manager_id=[$0], d_moy=[$1], $f2=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{6, 8}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcJoin(condition=[=($1, $5)], joinType=[inner]) + JdbcJoin(condition=[=($2, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_store_sk=[$2], ss_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_store_sk=[$7], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(i_item_sk=[$0], i_manager_id=[$4]) + JdbcFilter(condition=[AND(OR(AND(IN($3, _UTF-16LE'Books':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Children':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Electronics':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'personal':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'portable':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'refernece':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'self-help':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($1, _UTF-16LE'exportiunivamalg #9':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'scholaramalgamalg #14':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'scholaramalgamalg #7':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'scholaramalgamalg #9':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")), AND(IN($3, _UTF-16LE'Men':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Music':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Women':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'accessories':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'classical':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'fragrances':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'pants':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($1, _UTF-16LE'amalgimporto #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'edu packscholar #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'exportiimporto #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'importoamalg #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"))), IN($2, _UTF-16LE'accessories':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'classical':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'fragrances':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'pants':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'personal':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'portable':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'refernece':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'self-help':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($1, _UTF-16LE'amalgimporto #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'edu packscholar #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'exportiimporto #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'exportiunivamalg #9':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'importoamalg #1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'scholaramalgamalg #14':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'scholaramalgamalg #7':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'scholaramalgamalg #9':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($3, _UTF-16LE'Books':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Children':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Electronics':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Men':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Music':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Women':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_brand=[$8], i_class=[$10], i_category=[$12], i_manager_id=[$20]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_moy=[$2]) + JdbcFilter(condition=[AND(IN($1, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query64.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query64.q.out new file mode 100644 index 000000000000..929264697d93 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query64.q.out @@ -0,0 +1,217 @@ +CBO PLAN: +HiveProject(cs1.product_name=[$0], cs1.store_name=[$1], cs1.store_zip=[$2], cs1.b_street_number=[$3], cs1.b_streen_name=[$4], cs1.b_city=[$5], cs1.b_zip=[$6], cs1.c_street_number=[$7], cs1.c_street_name=[$8], cs1.c_city=[$9], cs1.c_zip=[$10], cs1.syear=[$11], cs1.cnt=[$12], cs1.s1=[$13], cs1.s2=[$14], cs1.s3=[$15], cs2.s1=[$16], cs2.s2=[$17], cs2.s3=[$18], cs2.syear=[$19], cs2.cnt=[$20]) + HiveProject(product_name=[$0], store_name=[$1], store_zip=[$2], b_street_number=[$3], b_streen_name=[$4], b_city=[$5], b_zip=[$6], c_street_number=[$7], c_street_name=[$8], c_city=[$9], c_zip=[$10], syear=[$11], cnt=[$12], s1=[$13], s2=[$14], s3=[$15], s11=[$16], s21=[$17], s31=[$18], syear1=[$19], cnt1=[$20]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(product_name=[$0], store_name=[$1], store_zip=[$2], b_street_number=[$3], b_streen_name=[$4], b_city=[$5], b_zip=[$6], c_street_number=[$7], c_street_name=[$8], c_city=[$9], c_zip=[$10], syear=[CAST(2000):INTEGER], cnt=[$11], s1=[$12], s2=[$13], s3=[$14], s11=[$15], s21=[$16], s31=[$17], syear1=[CAST(2001):INTEGER], cnt1=[$18]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$18], dir0=[ASC], dir1=[ASC], dir2=[ASC]) + JdbcProject(product_name=[$0], store_name=[$2], store_zip=[$3], b_street_number=[$4], b_streen_name=[$5], b_city=[$6], b_zip=[$7], c_street_number=[$8], c_street_name=[$9], c_city=[$10], c_zip=[$11], cnt=[$12], s1=[$13], s2=[$14], s3=[$15], s11=[$20], s21=[$21], s31=[$22], cnt1=[$19]) + JdbcJoin(condition=[AND(=($1, $16), <=($19, $12), =($2, $17), =($3, $18))], joinType=[inner]) + JdbcProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4], $f5=[$5], $f6=[$6], $f7=[$7], $f8=[$8], $f9=[$9], $f10=[$10], $f11=[$11], $f15=[$14], $f16=[$15], $f17=[$16], $f18=[$17]) + JdbcFilter(condition=[IS NOT NULL($14)]) + JdbcProject(i_product_name=[$1], i_item_sk=[$0], s_store_name=[$2], s_zip=[$3], ca_street_number=[$4], ca_street_name=[$5], ca_city=[$6], ca_zip=[$7], ca_street_number0=[$10], ca_street_name0=[$11], ca_city0=[$12], ca_zip0=[$13], d_year=[$8], d_year0=[$9], $f14=[$14], $f15=[$15], $f16=[$16], $f17=[$17]) + JdbcAggregate(group=[{17, 18, 23, 24, 26, 27, 28, 29, 39, 41, 46, 47, 48, 49}], agg#0=[count()], agg#1=[sum($9)], agg#2=[sum($10)], agg#3=[sum($11)]) + JdbcJoin(condition=[AND(<>($51, $37), =($3, $50))], joinType=[inner]) + JdbcJoin(condition=[=($2, $30)], joinType=[inner]) + JdbcJoin(condition=[=($5, $25)], joinType=[inner]) + JdbcJoin(condition=[=($6, $22)], joinType=[inner]) + JdbcJoin(condition=[=($4, $19)], joinType=[inner]) + JdbcJoin(condition=[=($1, $17)], joinType=[inner]) + JdbcJoin(condition=[=($1, $16)], joinType=[inner]) + JdbcJoin(condition=[AND(=($1, $14), =($8, $15))], joinType=[inner]) + JdbcJoin(condition=[=($7, $13)], joinType=[inner]) + JdbcJoin(condition=[=($0, $12)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2], ss_cdemo_sk=[$3], ss_hdemo_sk=[$4], ss_addr_sk=[$5], ss_store_sk=[$6], ss_promo_sk=[$7], ss_ticket_number=[$8], ss_wholesale_cost=[$9], ss_list_price=[$10], ss_coupon_amt=[$11]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($8), IS NOT NULL($0), IS NOT NULL($6), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($7), IS NOT NULL($4), IS NOT NULL($5))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_customer_sk=[$3], ss_cdemo_sk=[$4], ss_hdemo_sk=[$5], ss_addr_sk=[$6], ss_store_sk=[$7], ss_promo_sk=[$8], ss_ticket_number=[$9], ss_wholesale_cost=[$11], ss_list_price=[$12], ss_coupon_amt=[$19]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(p_promo_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(p_promo_sk=[$0]) + JdbcHiveTableScan(table=[[default, promotion]], table:alias=[promotion]) + JdbcProject(sr_item_sk=[$0], sr_ticket_number=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(sr_item_sk=[$2], sr_ticket_number=[$9]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject($f0=[$0]) + JdbcFilter(condition=[>($1, *(2:DECIMAL(10, 0), $2))]) + JdbcAggregate(group=[{0}], agg#0=[sum($2)], agg#1=[sum($5)]) + JdbcJoin(condition=[AND(=($0, $3), =($1, $4))], joinType=[inner]) + JdbcProject(cs_item_sk=[$0], cs_order_number=[$1], cs_ext_list_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cs_item_sk=[$15], cs_order_number=[$17], cs_ext_list_price=[$25]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(cr_item_sk=[$0], cr_order_number=[$1], $f2=[+(+($2, $3), $4)]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cr_item_sk=[$2], cr_order_number=[$16], cr_refunded_cash=[$23], cr_reversed_charge=[$24], cr_store_credit=[$25]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + JdbcProject(i_item_sk=[$0], i_product_name=[$3]) + JdbcFilter(condition=[AND(IN($2, _UTF-16LE'burnished':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'chocolate':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'dim':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'maroon':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'navajo':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'steel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), BETWEEN(false, $1, 36:DECIMAL(12, 2), 45:DECIMAL(12, 2)), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_current_price=[$5], i_color=[$17], i_product_name=[$21]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1], ib_income_band_sk=[$2]) + JdbcJoin(condition=[=($1, $2)], joinType=[inner]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[hd1]) + JdbcProject(ib_income_band_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ib_income_band_sk=[$0]) + JdbcHiveTableScan(table=[[default, income_band]], table:alias=[ib1]) + JdbcProject(s_store_sk=[$0], s_store_name=[$1], s_zip=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5], s_zip=[$25]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(ca_address_sk=[$0], ca_street_number=[$1], ca_street_name=[$2], ca_city=[$3], ca_zip=[$4]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_street_number=[$2], ca_street_name=[$3], ca_city=[$6], ca_zip=[$9]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[ad1]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_hdemo_sk=[$2], c_current_addr_sk=[$3], c_first_shipto_date_sk=[$4], c_first_sales_date_sk=[$5], cd_demo_sk=[$6], cd_marital_status=[$7], d_date_sk=[$8], d_year=[$9], d_date_sk0=[$10], d_year0=[$11], hd_demo_sk=[$12], hd_income_band_sk=[$13], ib_income_band_sk=[$14], ca_address_sk=[$15], ca_street_number=[$16], ca_street_name=[$17], ca_city=[$18], ca_zip=[$19]) + JdbcJoin(condition=[=($3, $15)], joinType=[inner]) + JdbcJoin(condition=[=($2, $12)], joinType=[inner]) + JdbcJoin(condition=[=($4, $10)], joinType=[inner]) + JdbcJoin(condition=[=($5, $8)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_hdemo_sk=[$2], c_current_addr_sk=[$3], c_first_shipto_date_sk=[$4], c_first_sales_date_sk=[$5]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($5), IS NOT NULL($4), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$2], c_current_hdemo_sk=[$3], c_current_addr_sk=[$4], c_first_shipto_date_sk=[$5], c_first_sales_date_sk=[$6]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$2]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[cd2]) + JdbcProject(d_date_sk=[$0], d_year=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d2]) + JdbcProject(d_date_sk=[$0], d_year=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d3]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1], ib_income_band_sk=[$2]) + JdbcJoin(condition=[=($1, $2)], joinType=[inner]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[hd2]) + JdbcProject(ib_income_band_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ib_income_band_sk=[$0]) + JdbcHiveTableScan(table=[[default, income_band]], table:alias=[ib2]) + JdbcProject(ca_address_sk=[$0], ca_street_number=[$1], ca_street_name=[$2], ca_city=[$3], ca_zip=[$4]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_street_number=[$2], ca_street_name=[$3], ca_city=[$6], ca_zip=[$9]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[ad2]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$2]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[cd1]) + JdbcProject($f1=[$1], $f2=[$2], $f3=[$3], $f15=[$14], $f16=[$15], $f17=[$16], $f18=[$17]) + JdbcFilter(condition=[IS NOT NULL($14)]) + JdbcProject(i_product_name=[$1], i_item_sk=[$0], s_store_name=[$2], s_zip=[$3], ca_street_number=[$4], ca_street_name=[$5], ca_city=[$6], ca_zip=[$7], ca_street_number0=[$10], ca_street_name0=[$11], ca_city0=[$12], ca_zip0=[$13], d_year=[$8], d_year0=[$9], $f14=[$14], $f15=[$15], $f16=[$16], $f17=[$17]) + JdbcAggregate(group=[{17, 18, 23, 24, 26, 27, 28, 29, 39, 41, 46, 47, 48, 49}], agg#0=[count()], agg#1=[sum($9)], agg#2=[sum($10)], agg#3=[sum($11)]) + JdbcJoin(condition=[AND(<>($51, $37), =($3, $50))], joinType=[inner]) + JdbcJoin(condition=[=($2, $30)], joinType=[inner]) + JdbcJoin(condition=[=($5, $25)], joinType=[inner]) + JdbcJoin(condition=[=($6, $22)], joinType=[inner]) + JdbcJoin(condition=[=($4, $19)], joinType=[inner]) + JdbcJoin(condition=[=($1, $17)], joinType=[inner]) + JdbcJoin(condition=[=($1, $16)], joinType=[inner]) + JdbcJoin(condition=[AND(=($1, $14), =($8, $15))], joinType=[inner]) + JdbcJoin(condition=[=($7, $13)], joinType=[inner]) + JdbcJoin(condition=[=($0, $12)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2], ss_cdemo_sk=[$3], ss_hdemo_sk=[$4], ss_addr_sk=[$5], ss_store_sk=[$6], ss_promo_sk=[$7], ss_ticket_number=[$8], ss_wholesale_cost=[$9], ss_list_price=[$10], ss_coupon_amt=[$11]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($8), IS NOT NULL($0), IS NOT NULL($6), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($7), IS NOT NULL($4), IS NOT NULL($5))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_customer_sk=[$3], ss_cdemo_sk=[$4], ss_hdemo_sk=[$5], ss_addr_sk=[$6], ss_store_sk=[$7], ss_promo_sk=[$8], ss_ticket_number=[$9], ss_wholesale_cost=[$11], ss_list_price=[$12], ss_coupon_amt=[$19]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(p_promo_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(p_promo_sk=[$0]) + JdbcHiveTableScan(table=[[default, promotion]], table:alias=[promotion]) + JdbcProject(sr_item_sk=[$0], sr_ticket_number=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(sr_item_sk=[$2], sr_ticket_number=[$9]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject($f0=[$0]) + JdbcFilter(condition=[>($1, *(2:DECIMAL(10, 0), $2))]) + JdbcAggregate(group=[{0}], agg#0=[sum($2)], agg#1=[sum($5)]) + JdbcJoin(condition=[AND(=($0, $3), =($1, $4))], joinType=[inner]) + JdbcProject(cs_item_sk=[$0], cs_order_number=[$1], cs_ext_list_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cs_item_sk=[$15], cs_order_number=[$17], cs_ext_list_price=[$25]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(cr_item_sk=[$0], cr_order_number=[$1], $f2=[+(+($2, $3), $4)]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cr_item_sk=[$2], cr_order_number=[$16], cr_refunded_cash=[$23], cr_reversed_charge=[$24], cr_store_credit=[$25]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + JdbcProject(i_item_sk=[$0], i_product_name=[$3]) + JdbcFilter(condition=[AND(IN($2, _UTF-16LE'burnished':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'chocolate':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'dim':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'maroon':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'navajo':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'steel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), BETWEEN(false, $1, 36:DECIMAL(12, 2), 45:DECIMAL(12, 2)), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_current_price=[$5], i_color=[$17], i_product_name=[$21]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1], ib_income_band_sk=[$2]) + JdbcJoin(condition=[=($1, $2)], joinType=[inner]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[hd1]) + JdbcProject(ib_income_band_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ib_income_band_sk=[$0]) + JdbcHiveTableScan(table=[[default, income_band]], table:alias=[ib1]) + JdbcProject(s_store_sk=[$0], s_store_name=[$1], s_zip=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5], s_zip=[$25]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(ca_address_sk=[$0], ca_street_number=[$1], ca_street_name=[$2], ca_city=[$3], ca_zip=[$4]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_street_number=[$2], ca_street_name=[$3], ca_city=[$6], ca_zip=[$9]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[ad1]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_hdemo_sk=[$2], c_current_addr_sk=[$3], c_first_shipto_date_sk=[$4], c_first_sales_date_sk=[$5], cd_demo_sk=[$6], cd_marital_status=[$7], d_date_sk=[$8], d_year=[$9], d_date_sk0=[$10], d_year0=[$11], hd_demo_sk=[$12], hd_income_band_sk=[$13], ib_income_band_sk=[$14], ca_address_sk=[$15], ca_street_number=[$16], ca_street_name=[$17], ca_city=[$18], ca_zip=[$19]) + JdbcJoin(condition=[=($3, $15)], joinType=[inner]) + JdbcJoin(condition=[=($2, $12)], joinType=[inner]) + JdbcJoin(condition=[=($4, $10)], joinType=[inner]) + JdbcJoin(condition=[=($5, $8)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_hdemo_sk=[$2], c_current_addr_sk=[$3], c_first_shipto_date_sk=[$4], c_first_sales_date_sk=[$5]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($5), IS NOT NULL($4), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$2], c_current_hdemo_sk=[$3], c_current_addr_sk=[$4], c_first_shipto_date_sk=[$5], c_first_sales_date_sk=[$6]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$2]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[cd2]) + JdbcProject(d_date_sk=[$0], d_year=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d2]) + JdbcProject(d_date_sk=[$0], d_year=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d3]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1], ib_income_band_sk=[$2]) + JdbcJoin(condition=[=($1, $2)], joinType=[inner]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[hd2]) + JdbcProject(ib_income_band_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ib_income_band_sk=[$0]) + JdbcHiveTableScan(table=[[default, income_band]], table:alias=[ib2]) + JdbcProject(ca_address_sk=[$0], ca_street_number=[$1], ca_street_name=[$2], ca_city=[$3], ca_zip=[$4]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_street_number=[$2], ca_street_name=[$3], ca_city=[$6], ca_zip=[$9]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[ad2]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$2]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[cd1]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query65.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query65.q.out new file mode 100644 index 000000000000..1b89e40ae625 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query65.q.out @@ -0,0 +1,44 @@ +CBO PLAN: +HiveProject(s_store_name=[$0], i_item_desc=[$1], sc.revenue=[$2], i_current_price=[$3], i_wholesale_cost=[$4], i_brand=[$5]) + HiveProject(s_store_name=[$0], i_item_desc=[$1], revenue=[$2], i_current_price=[$3], i_wholesale_cost=[$4], i_brand=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + JdbcProject(s_store_name=[$4], i_item_desc=[$8], revenue=[$2], i_current_price=[$9], i_wholesale_cost=[$10], i_brand=[$11]) + JdbcJoin(condition=[=($7, $1)], joinType=[inner]) + JdbcJoin(condition=[AND(=($5, $0), <=($2, $6))], joinType=[inner]) + JdbcJoin(condition=[=($3, $0)], joinType=[inner]) + JdbcProject(ss_store_sk=[$0], ss_item_sk=[$1], $f2=[$2]) + JdbcFilter(condition=[IS NOT NULL($2)]) + JdbcProject(ss_store_sk=[$1], ss_item_sk=[$0], $f2=[$2]) + JdbcAggregate(group=[{1, 2}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_store_sk=[$2], ss_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_store_sk=[$7], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0], s_store_name=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject($f0=[$0], EXPR$0=[*(0.1:DECIMAL(1, 1), CAST(/($1, $2)):DECIMAL(21, 6))]) + JdbcFilter(condition=[IS NOT NULL(CAST(/($1, $2)):DECIMAL(21, 6))]) + JdbcAggregate(group=[{1}], agg#0=[sum($2)], agg#1=[count($2)]) + JdbcAggregate(group=[{1, 2}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_store_sk=[$2], ss_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_store_sk=[$7], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0], i_item_desc=[$1], i_current_price=[$2], i_wholesale_cost=[$3], i_brand=[$4]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_desc=[$4], i_current_price=[$5], i_wholesale_cost=[$6], i_brand=[$8]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query66.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query66.q.out new file mode 100644 index 000000000000..f0dd0554183a --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query66.q.out @@ -0,0 +1,64 @@ +CBO PLAN: +HiveProject(w_warehouse_name=[$0], w_warehouse_sq_ft=[$1], w_city=[$2], w_county=[$3], w_state=[$4], w_country=[$5], ship_carriers=[$6], year=[$7], jan_sales=[$8], feb_sales=[$9], mar_sales=[$10], apr_sales=[$11], may_sales=[$12], jun_sales=[$13], jul_sales=[$14], aug_sales=[$15], sep_sales=[$16], oct_sales=[$17], nov_sales=[$18], dec_sales=[$19], jan_sales_per_sq_foot=[$20], feb_sales_per_sq_foot=[$21], mar_sales_per_sq_foot=[$22], apr_sales_per_sq_foot=[$23], may_sales_per_sq_foot=[$24], jun_sales_per_sq_foot=[$25], jul_sales_per_sq_foot=[$26], aug_sales_per_sq_foot=[$27], sep_sales_per_sq_foot=[$28], oct_sales_per_sq_foot=[$29], nov_sales_per_sq_foot=[$30], dec_sales_per_sq_foot=[$31], jan_net=[$32], feb_net=[$33], mar_net=[$34], apr_net=[$35], may_net=[$36], jun_net=[$37], jul_net=[$38], aug_net=[$39], sep_net=[$40], oct_net=[$41], nov_net=[$42], dec_net=[$43]) + HiveProject(w_warehouse_name=[$0], w_warehouse_sq_ft=[$1], w_city=[$2], w_county=[$3], w_state=[$4], w_country=[$5], ship_carriers=[$6], year=[$7], jan_sales=[$8], feb_sales=[$9], mar_sales=[$10], apr_sales=[$11], may_sales=[$12], jun_sales=[$13], jul_sales=[$14], aug_sales=[$15], sep_sales=[$16], oct_sales=[$17], nov_sales=[$18], dec_sales=[$19], jan_sales_per_sq_foot=[$20], feb_sales_per_sq_foot=[$21], mar_sales_per_sq_foot=[$22], apr_sales_per_sq_foot=[$23], may_sales_per_sq_foot=[$24], jun_sales_per_sq_foot=[$25], jul_sales_per_sq_foot=[$26], aug_sales_per_sq_foot=[$27], sep_sales_per_sq_foot=[$28], oct_sales_per_sq_foot=[$29], nov_sales_per_sq_foot=[$30], dec_sales_per_sq_foot=[$31], jan_net=[$32], feb_net=[$33], mar_net=[$34], apr_net=[$35], may_net=[$36], jun_net=[$37], jul_net=[$38], aug_net=[$39], sep_net=[$40], oct_net=[$41], nov_net=[$42], dec_net=[$43]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(w_warehouse_name=[$0], w_warehouse_sq_ft=[$1], w_city=[$2], w_county=[$3], w_state=[$4], w_country=[$5], ship_carriers=[CAST(_UTF-16LE'DIAMOND,AIRBORNE':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"):VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], year=[CAST(2002):INTEGER], jan_sales=[$6], feb_sales=[$7], mar_sales=[$8], apr_sales=[$9], may_sales=[$10], jun_sales=[$11], jul_sales=[$12], aug_sales=[$13], sep_sales=[$14], oct_sales=[$15], nov_sales=[$16], dec_sales=[$17], jan_sales_per_sq_foot=[$18], feb_sales_per_sq_foot=[$19], mar_sales_per_sq_foot=[$20], apr_sales_per_sq_foot=[$21], may_sales_per_sq_foot=[$22], jun_sales_per_sq_foot=[$23], jul_sales_per_sq_foot=[$24], aug_sales_per_sq_foot=[$25], sep_sales_per_sq_foot=[$26], oct_sales_per_sq_foot=[$27], nov_sales_per_sq_foot=[$28], dec_sales_per_sq_foot=[$29], jan_net=[$30], feb_net=[$31], mar_net=[$32], apr_net=[$33], may_net=[$34], jun_net=[$35], jul_net=[$36], aug_net=[$37], sep_net=[$38], oct_net=[$39], nov_net=[$40], dec_net=[$41]) + JdbcSort(sort0=[$0], dir0=[ASC], fetch=[100]) + JdbcAggregate(group=[{0, 1, 2, 3, 4, 5}], agg#0=[sum($6)], agg#1=[sum($7)], agg#2=[sum($8)], agg#3=[sum($9)], agg#4=[sum($10)], agg#5=[sum($11)], agg#6=[sum($12)], agg#7=[sum($13)], agg#8=[sum($14)], agg#9=[sum($15)], agg#10=[sum($16)], agg#11=[sum($17)], agg#12=[sum($18)], agg#13=[sum($19)], agg#14=[sum($20)], agg#15=[sum($21)], agg#16=[sum($22)], agg#17=[sum($23)], agg#18=[sum($24)], agg#19=[sum($25)], agg#20=[sum($26)], agg#21=[sum($27)], agg#22=[sum($28)], agg#23=[sum($29)], agg#24=[sum($30)], agg#25=[sum($31)], agg#26=[sum($32)], agg#27=[sum($33)], agg#28=[sum($34)], agg#29=[sum($35)], agg#30=[sum($36)], agg#31=[sum($37)], agg#32=[sum($38)], agg#33=[sum($39)], agg#34=[sum($40)], agg#35=[sum($41)]) + JdbcProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4], $f5=[$5], $f8=[$6], $f9=[$7], $f10=[$8], $f11=[$9], $f12=[$10], $f13=[$11], $f14=[$12], $f15=[$13], $f16=[$14], $f17=[$15], $f18=[$16], $f19=[$17], $f20=[/($6, CAST($1):DECIMAL(10, 0))], $f21=[/($7, CAST($1):DECIMAL(10, 0))], $f22=[/($8, CAST($1):DECIMAL(10, 0))], $f23=[/($9, CAST($1):DECIMAL(10, 0))], $f24=[/($10, CAST($1):DECIMAL(10, 0))], $f25=[/($11, CAST($1):DECIMAL(10, 0))], $f26=[/($12, CAST($1):DECIMAL(10, 0))], $f27=[/($13, CAST($1):DECIMAL(10, 0))], $f28=[/($14, CAST($1):DECIMAL(10, 0))], $f29=[/($15, CAST($1):DECIMAL(10, 0))], $f30=[/($16, CAST($1):DECIMAL(10, 0))], $f31=[/($17, CAST($1):DECIMAL(10, 0))], $f32=[$18], $f33=[$19], $f34=[$20], $f35=[$21], $f36=[$22], $f37=[$23], $f38=[$24], $f39=[$25], $f40=[$26], $f41=[$27], $f42=[$28], $f43=[$29]) + JdbcUnion(all=[true]) + JdbcProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4], $f5=[$5], $f6=[$6], $f7=[$7], $f8=[$8], $f9=[$9], $f10=[$10], $f11=[$11], $f12=[$12], $f13=[$13], $f14=[$14], $f15=[$15], $f16=[$16], $f17=[$17], $f18=[$18], $f19=[$19], $f20=[$20], $f21=[$21], $f22=[$22], $f23=[$23], $f24=[$24], $f25=[$25], $f26=[$26], $f27=[$27], $f28=[$28], $f29=[$29]) + JdbcAggregate(group=[{0, 1, 2, 3, 4, 5}], agg#0=[sum($6)], agg#1=[sum($7)], agg#2=[sum($8)], agg#3=[sum($9)], agg#4=[sum($10)], agg#5=[sum($11)], agg#6=[sum($12)], agg#7=[sum($13)], agg#8=[sum($14)], agg#9=[sum($15)], agg#10=[sum($16)], agg#11=[sum($17)], agg#12=[sum($18)], agg#13=[sum($19)], agg#14=[sum($20)], agg#15=[sum($21)], agg#16=[sum($22)], agg#17=[sum($23)], agg#18=[sum($24)], agg#19=[sum($25)], agg#20=[sum($26)], agg#21=[sum($27)], agg#22=[sum($28)], agg#23=[sum($29)]) + JdbcProject($f0=[$9], $f1=[$10], $f2=[$11], $f3=[$12], $f4=[$13], $f5=[$14], $f7=[CASE($16, $4, 0:DECIMAL(18, 2))], $f8=[CASE($17, $4, 0:DECIMAL(18, 2))], $f9=[CASE($18, $4, 0:DECIMAL(18, 2))], $f10=[CASE($19, $4, 0:DECIMAL(18, 2))], $f11=[CASE($20, $4, 0:DECIMAL(18, 2))], $f12=[CASE($21, $4, 0:DECIMAL(18, 2))], $f13=[CASE($22, $4, 0:DECIMAL(18, 2))], $f14=[CASE($23, $4, 0:DECIMAL(18, 2))], $f15=[CASE($24, $4, 0:DECIMAL(18, 2))], $f16=[CASE($25, $4, 0:DECIMAL(18, 2))], $f17=[CASE($26, $4, 0:DECIMAL(18, 2))], $f18=[CASE($27, $4, 0:DECIMAL(18, 2))], $f19=[CASE($16, $5, 0:DECIMAL(18, 2))], $f20=[CASE($17, $5, 0:DECIMAL(18, 2))], $f21=[CASE($18, $5, 0:DECIMAL(18, 2))], $f22=[CASE($19, $5, 0:DECIMAL(18, 2))], $f23=[CASE($20, $5, 0:DECIMAL(18, 2))], $f24=[CASE($21, $5, 0:DECIMAL(18, 2))], $f25=[CASE($22, $5, 0:DECIMAL(18, 2))], $f26=[CASE($23, $5, 0:DECIMAL(18, 2))], $f27=[CASE($24, $5, 0:DECIMAL(18, 2))], $f28=[CASE($25, $5, 0:DECIMAL(18, 2))], $f29=[CASE($26, $5, 0:DECIMAL(18, 2))], $f30=[CASE($27, $5, 0:DECIMAL(18, 2))]) + JdbcJoin(condition=[=($0, $15)], joinType=[inner]) + JdbcJoin(condition=[=($3, $8)], joinType=[inner]) + JdbcJoin(condition=[=($2, $7)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_sold_time_sk=[$1], ws_ship_mode_sk=[$2], ws_warehouse_sk=[$3], EXPR$0=[*($5, CAST($4):DECIMAL(10, 0))], EXPR$1=[*($6, CAST($4):DECIMAL(10, 0))]) + JdbcFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(ws_sold_date_sk=[$0], ws_sold_time_sk=[$1], ws_ship_mode_sk=[$14], ws_warehouse_sk=[$15], ws_quantity=[$18], ws_sales_price=[$21], ws_net_paid_inc_tax=[$30]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 49530, 78330), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_time=[$2]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(sm_ship_mode_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'AIRBORNE':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'DIAMOND':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(sm_ship_mode_sk=[$0], sm_carrier=[$4]) + JdbcHiveTableScan(table=[[default, ship_mode]], table:alias=[ship_mode]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$1], w_warehouse_sq_ft=[$2], w_city=[$3], w_county=[$4], w_state=[$5], w_country=[$6]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$2], w_warehouse_sq_ft=[$3], w_city=[$8], w_county=[$9], w_state=[$10], w_country=[$12]) + JdbcHiveTableScan(table=[[default, warehouse]], table:alias=[warehouse]) + JdbcProject(d_date_sk=[$0], EXPR$0=[=($2, 1)], EXPR$1=[=($2, 2)], EXPR$2=[=($2, 3)], EXPR$3=[=($2, 4)], EXPR$4=[=($2, 5)], EXPR$5=[=($2, 6)], EXPR$6=[=($2, 7)], EXPR$7=[=($2, 8)], EXPR$8=[=($2, 9)], EXPR$9=[=($2, 10)], EXPR$10=[=($2, 11)], EXPR$11=[=($2, 12)]) + JdbcFilter(condition=[AND(=($1, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4], $f5=[$5], $f6=[$6], $f7=[$7], $f8=[$8], $f9=[$9], $f10=[$10], $f11=[$11], $f12=[$12], $f13=[$13], $f14=[$14], $f15=[$15], $f16=[$16], $f17=[$17], $f18=[$18], $f19=[$19], $f20=[$20], $f21=[$21], $f22=[$22], $f23=[$23], $f24=[$24], $f25=[$25], $f26=[$26], $f27=[$27], $f28=[$28], $f29=[$29]) + JdbcAggregate(group=[{0, 1, 2, 3, 4, 5}], agg#0=[sum($6)], agg#1=[sum($7)], agg#2=[sum($8)], agg#3=[sum($9)], agg#4=[sum($10)], agg#5=[sum($11)], agg#6=[sum($12)], agg#7=[sum($13)], agg#8=[sum($14)], agg#9=[sum($15)], agg#10=[sum($16)], agg#11=[sum($17)], agg#12=[sum($18)], agg#13=[sum($19)], agg#14=[sum($20)], agg#15=[sum($21)], agg#16=[sum($22)], agg#17=[sum($23)], agg#18=[sum($24)], agg#19=[sum($25)], agg#20=[sum($26)], agg#21=[sum($27)], agg#22=[sum($28)], agg#23=[sum($29)]) + JdbcProject($f0=[$9], $f1=[$10], $f2=[$11], $f3=[$12], $f4=[$13], $f5=[$14], $f7=[CASE($16, $4, 0:DECIMAL(18, 2))], $f8=[CASE($17, $4, 0:DECIMAL(18, 2))], $f9=[CASE($18, $4, 0:DECIMAL(18, 2))], $f10=[CASE($19, $4, 0:DECIMAL(18, 2))], $f11=[CASE($20, $4, 0:DECIMAL(18, 2))], $f12=[CASE($21, $4, 0:DECIMAL(18, 2))], $f13=[CASE($22, $4, 0:DECIMAL(18, 2))], $f14=[CASE($23, $4, 0:DECIMAL(18, 2))], $f15=[CASE($24, $4, 0:DECIMAL(18, 2))], $f16=[CASE($25, $4, 0:DECIMAL(18, 2))], $f17=[CASE($26, $4, 0:DECIMAL(18, 2))], $f18=[CASE($27, $4, 0:DECIMAL(18, 2))], $f19=[CASE($16, $5, 0:DECIMAL(18, 2))], $f20=[CASE($17, $5, 0:DECIMAL(18, 2))], $f21=[CASE($18, $5, 0:DECIMAL(18, 2))], $f22=[CASE($19, $5, 0:DECIMAL(18, 2))], $f23=[CASE($20, $5, 0:DECIMAL(18, 2))], $f24=[CASE($21, $5, 0:DECIMAL(18, 2))], $f25=[CASE($22, $5, 0:DECIMAL(18, 2))], $f26=[CASE($23, $5, 0:DECIMAL(18, 2))], $f27=[CASE($24, $5, 0:DECIMAL(18, 2))], $f28=[CASE($25, $5, 0:DECIMAL(18, 2))], $f29=[CASE($26, $5, 0:DECIMAL(18, 2))], $f30=[CASE($27, $5, 0:DECIMAL(18, 2))]) + JdbcJoin(condition=[=($0, $15)], joinType=[inner]) + JdbcJoin(condition=[=($3, $8)], joinType=[inner]) + JdbcJoin(condition=[=($2, $7)], joinType=[inner]) + JdbcJoin(condition=[=($1, $6)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_sold_time_sk=[$1], cs_ship_mode_sk=[$2], cs_warehouse_sk=[$3], EXPR$0=[*($5, CAST($4):DECIMAL(10, 0))], EXPR$1=[*($6, CAST($4):DECIMAL(10, 0))]) + JdbcFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(cs_sold_date_sk=[$0], cs_sold_time_sk=[$1], cs_ship_mode_sk=[$13], cs_warehouse_sk=[$14], cs_quantity=[$18], cs_ext_sales_price=[$23], cs_net_paid_inc_ship_tax=[$32]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 49530, 78330), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_time=[$2]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(sm_ship_mode_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'AIRBORNE':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'DIAMOND':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(sm_ship_mode_sk=[$0], sm_carrier=[$4]) + JdbcHiveTableScan(table=[[default, ship_mode]], table:alias=[ship_mode]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$1], w_warehouse_sq_ft=[$2], w_city=[$3], w_county=[$4], w_state=[$5], w_country=[$6]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$2], w_warehouse_sq_ft=[$3], w_city=[$8], w_county=[$9], w_state=[$10], w_country=[$12]) + JdbcHiveTableScan(table=[[default, warehouse]], table:alias=[warehouse]) + JdbcProject(d_date_sk=[$0], EXPR$0=[=($2, 1)], EXPR$1=[=($2, 2)], EXPR$2=[=($2, 3)], EXPR$3=[=($2, 4)], EXPR$4=[=($2, 5)], EXPR$5=[=($2, 6)], EXPR$6=[=($2, 7)], EXPR$7=[=($2, 8)], EXPR$8=[=($2, 9)], EXPR$9=[=($2, 10)], EXPR$10=[=($2, 11)], EXPR$11=[=($2, 12)]) + JdbcFilter(condition=[AND(=($1, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query67.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query67.q.out new file mode 100644 index 000000000000..aa81f8e947fc --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query67.q.out @@ -0,0 +1,29 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], sort4=[$4], sort5=[$5], sort6=[$6], sort7=[$7], sort8=[$8], sort9=[$9], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], dir5=[ASC], dir6=[ASC], dir7=[ASC], dir8=[ASC], dir9=[ASC], fetch=[100]) + HiveProject(dw2.i_category=[$0], dw2.i_class=[$1], dw2.i_brand=[$2], dw2.i_product_name=[$3], dw2.d_year=[$4], dw2.d_qoy=[$5], dw2.d_moy=[$6], dw2.s_store_id=[$7], dw2.sumsales=[$8], dw2.rk=[$9]) + HiveFilter(condition=[<=($9, 100)]) + HiveProject(i_category=[$6], i_class=[$5], i_brand=[$4], i_product_name=[$7], d_year=[$1], d_qoy=[$3], d_moy=[$2], s_store_id=[$0], sumsales=[$8], rank_window_0=[rank() OVER (PARTITION BY $6 ORDER BY $8 DESC NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(s_store_id=[$0], d_year=[$1], d_moy=[$2], d_qoy=[$3], i_brand=[$4], i_class=[$5], i_category=[$6], i_product_name=[$7], $f8=[$8]) + HiveAggregate(group=[{5, 7, 8, 9, 11, 12, 13, 14}], groups=[[{5, 7, 8, 9, 11, 12, 13, 14}, {7, 8, 9, 11, 12, 13, 14}, {7, 9, 11, 12, 13, 14}, {7, 11, 12, 13, 14}, {11, 12, 13, 14}, {11, 12, 13}, {12, 13}, {13}, {}]], agg#0=[sum($3)]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_store_sk=[$2], $f8=[$3], s_store_sk=[$4], s_store_id=[$5], d_date_sk=[$6], d_year=[$7], d_moy=[$8], d_qoy=[$9], i_item_sk=[$10], i_brand=[$11], i_class=[$12], i_category=[$13], i_product_name=[$14]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($1, $10)], joinType=[inner]) + JdbcJoin(condition=[=($0, $6)], joinType=[inner]) + JdbcJoin(condition=[=($2, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_store_sk=[$2], $f8=[CASE(AND(IS NOT NULL($4), IS NOT NULL(CAST($3):DECIMAL(10, 0))), *($4, CAST($3):DECIMAL(10, 0)), 0:DECIMAL(18, 2))]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_store_sk=[$7], ss_quantity=[$10], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(d_date_sk=[$0], d_year=[$2], d_moy=[$3], d_qoy=[$4]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3], d_year=[$6], d_moy=[$8], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0], i_brand=[$1], i_class=[$2], i_category=[$3], i_product_name=[$4]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_brand=[$8], i_class=[$10], i_category=[$12], i_product_name=[$21]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query68.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query68.q.out new file mode 100644 index 000000000000..099171af1fdb --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query68.q.out @@ -0,0 +1,43 @@ +CBO PLAN: +HiveProject(c_last_name=[$0], c_first_name=[$1], ca_city=[$2], bought_city=[$3], ss_ticket_number=[$4], extended_price=[$5], extended_tax=[$6], list_price=[$7]) + HiveProject(c_last_name=[$0], c_first_name=[$1], ca_city=[$2], bought_city=[$3], ss_ticket_number=[$4], extended_price=[$5], extended_tax=[$6], list_price=[$7]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], sort1=[$4], dir0=[ASC], dir1=[ASC], fetch=[100]) + JdbcProject(c_last_name=[$3], c_first_name=[$2], ca_city=[$5], bought_city=[$8], ss_ticket_number=[$6], extended_price=[$9], extended_tax=[$11], list_price=[$10]) + JdbcJoin(condition=[AND(<>($5, $8), =($7, $0))], joinType=[inner]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$1], c_first_name=[$2], c_last_name=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$4], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(ca_address_sk=[$0], ca_city=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_city=[$6]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[current_addr]) + JdbcProject(ss_ticket_number=[$2], ss_customer_sk=[$0], bought_city=[$3], extended_price=[$4], list_price=[$5], extended_tax=[$6]) + JdbcAggregate(group=[{1, 3, 5, 13}], agg#0=[sum($6)], agg#1=[sum($7)], agg#2=[sum($8)]) + JdbcJoin(condition=[=($3, $12)], joinType=[inner]) + JdbcJoin(condition=[=($2, $11)], joinType=[inner]) + JdbcJoin(condition=[=($4, $10)], joinType=[inner]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], ss_hdemo_sk=[$2], ss_addr_sk=[$3], ss_store_sk=[$4], ss_ticket_number=[$5], ss_ext_sales_price=[$6], ss_ext_list_price=[$7], ss_ext_tax=[$8]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($4), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_hdemo_sk=[$5], ss_addr_sk=[$6], ss_store_sk=[$7], ss_ticket_number=[$9], ss_ext_sales_price=[$15], ss_ext_list_price=[$17], ss_ext_tax=[$18]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, 1998, 1999, 2000), BETWEEN(false, $2, 1, 2), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_dom=[$9]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'Cedar Grove':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Wildwood':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_city=[$22]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(OR(=($1, 2), =($2, 1)), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(ca_address_sk=[$0], ca_city=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_city=[$6]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query69.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query69.q.out new file mode 100644 index 000000000000..aaab01b1fb0b --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query69.q.out @@ -0,0 +1,62 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$4], sort4=[$6], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], fetch=[100]) + HiveProject(cd_gender=[$0], cd_marital_status=[$1], cd_education_status=[$2], cnt1=[$5], cd_purchase_estimate=[$3], cnt2=[$5], cd_credit_rating=[$4], cnt3=[$5]) + HiveAggregate(group=[{6, 7, 8, 9, 10}], agg#0=[count()]) + HiveAntiJoin(condition=[=($0, $14)], joinType=[anti]) + HiveProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_addr_sk=[$2], ca_address_sk=[$3], ca_state=[$4], cd_demo_sk=[$5], cd_gender=[$6], cd_marital_status=[$7], cd_education_status=[$8], cd_purchase_estimate=[$9], cd_credit_rating=[$10], literalTrue=[$11], ws_bill_customer_sk=[$12]) + HiveFilter(condition=[IS NULL($11)]) + HiveJoin(condition=[=($0, $12)], joinType=[left], algorithm=[none], cost=[not available]) + HiveSemiJoin(condition=[=($0, $11)], joinType=[semi]) + HiveProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_addr_sk=[$2], ca_address_sk=[$3], ca_state=[$4], cd_demo_sk=[$5], cd_gender=[$6], cd_marital_status=[$7], cd_education_status=[$8], cd_purchase_estimate=[$9], cd_credit_rating=[$10]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($5, $1)], joinType=[inner]) + JdbcJoin(condition=[=($2, $3)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_addr_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$2], c_current_addr_sk=[$4]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[c]) + JdbcProject(ca_address_sk=[$0], ca_state=[$1]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'CO':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'IL':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MN':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[ca]) + JdbcProject(cd_demo_sk=[$0], cd_gender=[$1], cd_marital_status=[$2], cd_education_status=[$3], cd_purchase_estimate=[$4], cd_credit_rating=[$5]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cd_demo_sk=[$0], cd_gender=[$1], cd_marital_status=[$2], cd_education_status=[$3], cd_purchase_estimate=[$4], cd_credit_rating=[$5]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[customer_demographics]) + HiveProject(ss_customer_sk=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ss_customer_sk=[$1]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), BETWEEN(false, $2, 1, 3), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(literalTrue=[$0], ws_bill_customer_sk=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(literalTrue=[true], ws_bill_customer_sk=[$1]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$4]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), BETWEEN(false, $2, 1, 3), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(literalTrue=[$0], cs_ship_customer_sk=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(literalTrue=[true], cs_ship_customer_sk=[$1]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_ship_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_ship_customer_sk=[$7]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), BETWEEN(false, $2, 1, 3), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query7.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query7.q.out new file mode 100644 index 000000000000..e59a07117d7f --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query7.q.out @@ -0,0 +1,32 @@ +CBO PLAN: +HiveProject(i_item_id=[$0], agg1=[$1], agg2=[$2], agg3=[$3], agg4=[$4]) + HiveProject(i_item_id=[$0], agg1=[$1], agg2=[$2], agg3=[$3], agg4=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], dir0=[ASC], fetch=[100]) + JdbcProject(i_item_id=[$0], agg1=[/(CAST($1):DOUBLE, $2)], agg2=[CAST(/($3, $4)):DECIMAL(11, 6)], agg3=[CAST(/($5, $6)):DECIMAL(11, 6)], agg4=[CAST(/($7, $8)):DECIMAL(11, 6)]) + JdbcAggregate(group=[{12}], agg#0=[sum($4)], agg#1=[count($4)], agg#2=[sum($5)], agg#3=[count($5)], agg#4=[sum($7)], agg#5=[count($7)], agg#6=[sum($6)], agg#7=[count($6)]) + JdbcJoin(condition=[=($1, $11)], joinType=[inner]) + JdbcJoin(condition=[=($3, $10)], joinType=[inner]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcJoin(condition=[=($2, $8)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_cdemo_sk=[$2], ss_promo_sk=[$3], ss_quantity=[$4], ss_list_price=[$5], ss_sales_price=[$6], ss_coupon_amt=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($3))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_cdemo_sk=[$4], ss_promo_sk=[$8], ss_quantity=[$10], ss_list_price=[$12], ss_sales_price=[$13], ss_coupon_amt=[$19]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(cd_demo_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'F'), =($2, _UTF-16LE'W'), =($3, _UTF-16LE'Primary'), IS NOT NULL($0))]) + JdbcProject(cd_demo_sk=[$0], cd_gender=[$1], cd_marital_status=[$2], cd_education_status=[$3]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[customer_demographics]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1998), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(p_promo_sk=[$0]) + JdbcFilter(condition=[AND(OR(=($1, _UTF-16LE'N'), =($2, _UTF-16LE'N')), IS NOT NULL($0))]) + JdbcProject(p_promo_sk=[$0], p_channel_email=[$9], p_channel_event=[$14]) + JdbcHiveTableScan(table=[[default, promotion]], table:alias=[promotion]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query70.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query70.q.out new file mode 100644 index 000000000000..982ab5602567 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query70.q.out @@ -0,0 +1,45 @@ +CBO PLAN: +HiveProject(total_sum=[$0], s_state=[$1], s_county=[$2], lochierarchy=[$3], rank_within_parent=[$4]) + HiveSortLimit(sort0=[$3], sort1=[$5], sort2=[$4], dir0=[DESC], dir1=[ASC], dir2=[ASC], fetch=[100]) + HiveProject(total_sum=[$2], s_state=[$0], s_county=[$1], lochierarchy=[+(grouping($3, 1:BIGINT), grouping($3, 0:BIGINT))], rank_within_parent=[rank() OVER (PARTITION BY +(grouping($3, 1:BIGINT), grouping($3, 0:BIGINT)), CASE(=(grouping($3, 0:BIGINT), CAST(0):BIGINT), $0, null:VARCHAR(2147483647) CHARACTER SET "UTF-16LE") ORDER BY $2 DESC NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)], (tok_function when (= (tok_table_or_col lochierarchy) 0) (tok_table_or_col s_state))=[CASE(=(+(grouping($3, 1:BIGINT), grouping($3, 0:BIGINT)), 0), $0, null:VARCHAR(2147483647) CHARACTER SET "UTF-16LE")]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], GROUPING__ID=[$3]) + HiveAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], agg#0=[sum($2)], GROUPING__ID=[GROUPING__ID()]) + HiveProject($f0=[$7], $f1=[$6], $f2=[$2]) + HiveSemiJoin(condition=[=($7, $8)], joinType=[semi]) + HiveProject(ss_sold_date_sk=[$0], ss_store_sk=[$1], ss_net_profit=[$2], d_date_sk=[$3], d_month_seq=[$4], s_store_sk=[$5], s_county=[$6], s_state=[$7]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($5, $1)], joinType=[inner]) + JdbcJoin(condition=[=($3, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$1], ss_net_profit=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$7], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(s_store_sk=[$0], s_county=[$1], s_state=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_county=[$23], s_state=[$24]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject(s_state=[$0]) + HiveFilter(condition=[<=($1, 5)]) + HiveProject((tok_table_or_col s_state)=[$0], rank_window_0=[rank() OVER (PARTITION BY $0 ORDER BY $1 DESC NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(s_state=[$0], $f1=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{5}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($4, $1)], joinType=[inner]) + JdbcJoin(condition=[=($3, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$1], ss_net_profit=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$7], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0], s_state=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(s_store_sk=[$0], s_state=[$24]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query71.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query71.q.out new file mode 100644 index 000000000000..1b65810d3110 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query71.q.out @@ -0,0 +1,61 @@ +CBO PLAN: +HiveProject(brand_id=[$0], brand=[$1], t_hour=[$2], t_minute=[$3], ext_price=[$4]) + HiveSortLimit(sort0=[$4], sort1=[$5], dir0=[DESC], dir1=[ASC]) + HiveProject(brand_id=[$0], brand=[$1], t_hour=[$2], t_minute=[$3], ext_price=[$4], (tok_table_or_col i_brand_id)=[$0]) + HiveAggregate(group=[{4, 5, 7, 8}], agg#0=[sum($0)]) + HiveJoin(condition=[=($2, $6)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($1, $3)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ext_price=[$0], sold_item_sk=[$1], time_sk=[$2]) + HiveUnion(all=[true]) + HiveProject(ext_price=[$0], sold_item_sk=[$1], time_sk=[$2]) + HiveProject(ext_price=[$0], sold_item_sk=[$1], time_sk=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ext_price=[$3], sold_item_sk=[$2], time_sk=[$1]) + JdbcJoin(condition=[=($4, $0)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_sold_time_sk=[$1], ws_item_sk=[$2], ws_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_sold_time_sk=[$1], ws_item_sk=[$3], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 12), =($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(ext_price=[$0], sold_item_sk=[$1], time_sk=[$2]) + HiveProject(ext_price=[$0], sold_item_sk=[$1], time_sk=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ext_price=[$3], sold_item_sk=[$2], time_sk=[$1]) + JdbcJoin(condition=[=($4, $0)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_sold_time_sk=[$1], cs_item_sk=[$2], cs_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(cs_sold_date_sk=[$0], cs_sold_time_sk=[$1], cs_item_sk=[$15], cs_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 12), =($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(ext_price=[$0], sold_item_sk=[$1], time_sk=[$2]) + HiveProject(ext_price=[$0], sold_item_sk=[$1], time_sk=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ext_price=[$3], sold_item_sk=[$2], time_sk=[$1]) + JdbcJoin(condition=[=($4, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_sold_time_sk=[$1], ss_item_sk=[$2], ss_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_sold_time_sk=[$1], ss_item_sk=[$2], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 12), =($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(i_item_sk=[$0], i_brand_id=[$1], i_brand=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_brand=[$2]) + JdbcFilter(condition=[AND(=($3, 1), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_brand=[$8], i_manager_id=[$20]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + HiveProject(t_time_sk=[$0], t_hour=[$1], t_minute=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(t_time_sk=[$0], t_hour=[$1], t_minute=[$2]) + JdbcFilter(condition=[AND(IN($3, _UTF-16LE'breakfast':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'dinner':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_hour=[$3], t_minute=[$4], t_meal_time=[$9]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query72.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query72.q.out new file mode 100644 index 000000000000..9b78ad386c43 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query72.q.out @@ -0,0 +1,63 @@ +CBO PLAN: +HiveProject(i_item_desc=[$0], w_warehouse_name=[$1], d1.d_week_seq=[$2], no_promo=[$3], promo=[$4], total_cnt=[$5]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4], $f5=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$5], sort1=[$0], sort2=[$1], sort3=[$2], dir0=[DESC], dir1=[ASC], dir2=[ASC], dir3=[ASC], fetch=[100]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[count($3)], agg#1=[count($4)], agg#2=[count()]) + JdbcProject($f0=[$15], $f1=[$13], $f2=[$19], $f3=[CASE(IS NULL($25), 1, 0)], $f4=[CASE(IS NOT NULL($25), 1, 0)]) + JdbcJoin(condition=[AND(=($26, $4), =($27, $6))], joinType=[left]) + JdbcProject(cs_sold_date_sk=[$0], cs_ship_date_sk=[$1], cs_bill_cdemo_sk=[$2], cs_bill_hdemo_sk=[$3], cs_item_sk=[$4], cs_promo_sk=[$5], cs_order_number=[$6], cs_quantity=[$7], inv_date_sk=[$13], inv_item_sk=[$14], inv_warehouse_sk=[$15], inv_quantity_on_hand=[$16], w_warehouse_sk=[$19], w_warehouse_name=[$20], i_item_sk=[$11], i_item_desc=[$12], cd_demo_sk=[$8], hd_demo_sk=[$9], d_date_sk=[$21], d_week_seq=[$22], EXPR$0=[$23], d_date_sk0=[$17], d_week_seq0=[$18], d_date_sk1=[$24], EXPR$00=[$25], p_promo_sk=[$10]) + JdbcJoin(condition=[AND(=($1, $24), >($25, $23))], joinType=[inner]) + JdbcJoin(condition=[AND(=($22, $18), =($0, $21))], joinType=[inner]) + JdbcJoin(condition=[AND(=($4, $14), <($16, $7))], joinType=[inner]) + JdbcJoin(condition=[=($11, $4)], joinType=[inner]) + JdbcJoin(condition=[=($5, $10)], joinType=[left]) + JdbcJoin(condition=[=($3, $9)], joinType=[inner]) + JdbcJoin(condition=[=($2, $8)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_ship_date_sk=[$1], cs_bill_cdemo_sk=[$2], cs_bill_hdemo_sk=[$3], cs_item_sk=[$4], cs_promo_sk=[$5], cs_order_number=[$6], cs_quantity=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($4), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($7))]) + JdbcProject(cs_sold_date_sk=[$0], cs_ship_date_sk=[$2], cs_bill_cdemo_sk=[$4], cs_bill_hdemo_sk=[$5], cs_item_sk=[$15], cs_promo_sk=[$16], cs_order_number=[$17], cs_quantity=[$18]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(cd_demo_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'M'), IS NOT NULL($0))]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$2]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[customer_demographics]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'1001-5000'), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_buy_potential=[$2]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(p_promo_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(p_promo_sk=[$0]) + JdbcHiveTableScan(table=[[default, promotion]], table:alias=[promotion]) + JdbcProject(i_item_sk=[$0], i_item_desc=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_desc=[$4]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(inv_date_sk=[$0], inv_item_sk=[$1], inv_warehouse_sk=[$2], inv_quantity_on_hand=[$3], d_date_sk=[$4], d_week_seq=[$5], w_warehouse_sk=[$6], w_warehouse_name=[$7]) + JdbcJoin(condition=[=($6, $2)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(inv_date_sk=[$0], inv_item_sk=[$1], inv_warehouse_sk=[$2], inv_quantity_on_hand=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($0), IS NOT NULL($3))]) + JdbcHiveTableScan(table=[[default, inventory]], table:alias=[inventory]) + JdbcProject(d_date_sk=[$0], d_week_seq=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(d_date_sk=[$0], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d2]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$2]) + JdbcHiveTableScan(table=[[default, warehouse]], table:alias=[warehouse]) + JdbcProject(d_date_sk=[$0], d_week_seq=[$2], EXPR$0=[+(CAST($1):DOUBLE, 5)]) + JdbcFilter(condition=[AND(=($3, 2001), IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL(CAST($1):DOUBLE))]) + JdbcProject(d_date_sk=[$0], d_date=[$2], d_week_seq=[$4], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(d_date_sk=[$0], EXPR$0=[CAST($1):DOUBLE]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL(CAST($1):DOUBLE))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d3]) + JdbcProject(cr_item_sk=[$0], cr_order_number=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cr_item_sk=[$2], cr_order_number=[$16]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query73.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query73.q.out new file mode 100644 index 000000000000..d14bbf2b30f0 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query73.q.out @@ -0,0 +1,35 @@ +CBO PLAN: +HiveProject(c_last_name=[$0], c_first_name=[$1], c_salutation=[$2], c_preferred_cust_flag=[$3], ss_ticket_number=[$4], cnt=[$5]) + HiveProject(c_last_name=[$0], c_first_name=[$1], c_salutation=[$2], c_preferred_cust_flag=[$3], ss_ticket_number=[$4], cnt=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$5], dir0=[DESC]) + JdbcProject(c_last_name=[$3], c_first_name=[$2], c_salutation=[$1], c_preferred_cust_flag=[$4], ss_ticket_number=[$5], cnt=[$7]) + JdbcJoin(condition=[=($6, $0)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_salutation=[$1], c_first_name=[$2], c_last_name=[$3], c_preferred_cust_flag=[$4]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0], c_salutation=[$7], c_first_name=[$8], c_last_name=[$9], c_preferred_cust_flag=[$10]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(ss_ticket_number=[$0], ss_customer_sk=[$1], $f2=[$2]) + JdbcFilter(condition=[BETWEEN(false, $2, 1:BIGINT, 5:BIGINT)]) + JdbcProject(ss_ticket_number=[$1], ss_customer_sk=[$0], $f2=[$2]) + JdbcAggregate(group=[{1, 4}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $7)], joinType=[inner]) + JdbcJoin(condition=[=($3, $6)], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], ss_hdemo_sk=[$2], ss_store_sk=[$3], ss_ticket_number=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($3), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_hdemo_sk=[$5], ss_store_sk=[$7], ss_ticket_number=[$9]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, 2000, 2001, 2002), BETWEEN(false, $2, 1, 2), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_dom=[$9]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'Huron County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Kittitas County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Maverick County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Mobile County':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_county=[$23]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(>($3, 0), IN($1, _UTF-16LE'>10000':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'unknown':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), CASE(>($3, 0), >(/(CAST($2):DOUBLE, CAST($3):DOUBLE), 1), false), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_buy_potential=[$2], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query74.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query74.q.out new file mode 100644 index 000000000000..2d74df2cb746 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query74.q.out @@ -0,0 +1,75 @@ +CBO PLAN: +HiveProject(t_s_secyear.customer_id=[$0], t_s_secyear.customer_first_name=[$1], t_s_secyear.customer_last_name=[$2]) + HiveProject(customer_id=[$0], customer_first_name=[$1], customer_last_name=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$2], sort1=[$0], sort2=[$1], dir0=[ASC], dir1=[ASC], dir2=[ASC], fetch=[100]) + JdbcProject(customer_id=[$8], customer_first_name=[$9], customer_last_name=[$10]) + JdbcJoin(condition=[AND(=($8, $0), CASE($2, CASE($7, >(/($4, $6), /($11, $1)), false), false))], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(customer_id=[$0], year_total=[$3], EXPR$0=[>($3, 0:DECIMAL(1, 0))]) + JdbcFilter(condition=[>($3, 0:DECIMAL(1, 0))]) + JdbcAggregate(group=[{5, 6, 7}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($4, $1)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], ss_net_paid=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_net_paid=[$20]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1998), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(customer_id=[$0], year_total=[$3]) + JdbcAggregate(group=[{5, 6, 7}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($4, $1)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$1], ws_net_paid=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$4], ws_net_paid=[$29]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(customer_id=[$0], year_total=[$3], EXPR$1=[>($3, 0:DECIMAL(1, 0))]) + JdbcFilter(condition=[>($3, 0:DECIMAL(1, 0))]) + JdbcAggregate(group=[{5, 6, 7}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($4, $1)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$1], ws_net_paid=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$4], ws_net_paid=[$29]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1998), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcAggregate(group=[{5, 6, 7}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($4, $1)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], ss_net_paid=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_net_paid=[$20]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$2], c_last_name=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query75.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query75.q.out new file mode 100644 index 000000000000..3fbde48a76bf --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query75.q.out @@ -0,0 +1,145 @@ +CBO PLAN: +HiveProject(prev_year=[$0], year=[$1], curr_yr.i_brand_id=[$2], curr_yr.i_class_id=[$3], curr_yr.i_category_id=[$4], curr_yr.i_manufact_id=[$5], prev_yr_cnt=[$6], curr_yr_cnt=[$7], sales_cnt_diff=[$8], sales_amt_diff=[$9]) + HiveProject(prev_year=[$0], year=[$1], i_brand_id=[$2], i_class_id=[$3], i_category_id=[$4], i_manufact_id=[$5], prev_yr_cnt=[$6], curr_yr_cnt=[$7], sales_cnt_diff=[$8], sales_amt_diff=[$9]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(prev_year=[CAST(2001):INTEGER], year=[CAST(2002):INTEGER], i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], i_manufact_id=[$3], prev_yr_cnt=[$4], curr_yr_cnt=[$5], sales_cnt_diff=[$6], sales_amt_diff=[$7]) + JdbcSort(sort0=[$6], dir0=[ASC], fetch=[100]) + JdbcProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], i_manufact_id=[$3], prev_yr_cnt=[$10], curr_yr_cnt=[$4], sales_cnt_diff=[-($4, $10)], sales_amt_diff=[-($5, $11)]) + JdbcJoin(condition=[AND(=($0, $6), =($1, $7), =($2, $8), =($3, $9), <(/(CAST($4):DECIMAL(17, 2), CAST($10):DECIMAL(17, 2)), 0.9:DECIMAL(1, 1)))], joinType=[inner]) + JdbcAggregate(group=[{0, 1, 2, 3}], agg#0=[sum($4)], agg#1=[sum($5)]) + JdbcAggregate(group=[{0, 1, 2, 3, 4, 5}]) + JdbcProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], i_manufact_id=[$3], sales_cnt=[$4], sales_amt=[$5]) + JdbcUnion(all=[true]) + JdbcProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], i_manufact_id=[$3], sales_cnt=[$4], sales_amt=[$5]) + JdbcAggregate(group=[{0, 1, 2, 3, 4, 5}]) + JdbcProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], i_manufact_id=[$3], sales_cnt=[$4], sales_amt=[$5]) + JdbcUnion(all=[true]) + JdbcProject(i_brand_id=[$11], i_class_id=[$12], i_category_id=[$13], i_manufact_id=[$14], sales_cnt=[-($3, CASE(IS NOT NULL($8), $8, 0))], sales_amt=[-($4, CASE(IS NOT NULL($9), $9, 0:DECIMAL(1, 0)))]) + JdbcJoin(condition=[=($10, $1)], joinType=[inner]) + JdbcJoin(condition=[AND(=($2, $7), =($1, $6))], joinType=[left]) + JdbcJoin(condition=[=($5, $0)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$1], cs_order_number=[$2], cs_quantity=[$3], cs_ext_sales_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$15], cs_order_number=[$17], cs_quantity=[$18], cs_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(cr_item_sk=[$0], cr_order_number=[$1], cr_return_quantity=[$2], cr_return_amount=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cr_item_sk=[$2], cr_order_number=[$16], cr_return_quantity=[$17], cr_return_amount=[$18]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3], i_manufact_id=[$5]) + JdbcFilter(condition=[AND(=($4, _UTF-16LE'Sports'), IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($5))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11], i_category=[$12], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(i_brand_id=[$11], i_class_id=[$12], i_category_id=[$13], i_manufact_id=[$14], sales_cnt=[-($3, CASE(IS NOT NULL($8), $8, 0))], sales_amt=[-($4, CASE(IS NOT NULL($9), $9, 0:DECIMAL(1, 0)))]) + JdbcJoin(condition=[=($10, $1)], joinType=[inner]) + JdbcJoin(condition=[AND(=($2, $7), =($1, $6))], joinType=[left]) + JdbcJoin(condition=[=($5, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_ticket_number=[$2], ss_quantity=[$3], ss_ext_sales_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_ticket_number=[$9], ss_quantity=[$10], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(sr_item_sk=[$0], sr_ticket_number=[$1], sr_return_quantity=[$2], sr_return_amt=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(sr_item_sk=[$2], sr_ticket_number=[$9], sr_return_quantity=[$10], sr_return_amt=[$11]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3], i_manufact_id=[$5]) + JdbcFilter(condition=[AND(=($4, _UTF-16LE'Sports'), IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($5))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11], i_category=[$12], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(i_brand_id=[$11], i_class_id=[$12], i_category_id=[$13], i_manufact_id=[$14], sales_cnt=[-($3, CASE(IS NOT NULL($8), $8, 0))], sales_amt=[-($4, CASE(IS NOT NULL($9), $9, 0:DECIMAL(1, 0)))]) + JdbcJoin(condition=[=($10, $1)], joinType=[inner]) + JdbcJoin(condition=[AND(=($2, $7), =($1, $6))], joinType=[left]) + JdbcJoin(condition=[=($5, $0)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_order_number=[$2], ws_quantity=[$3], ws_ext_sales_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_order_number=[$17], ws_quantity=[$18], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(wr_item_sk=[$0], wr_order_number=[$1], wr_return_quantity=[$2], wr_return_amt=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(wr_item_sk=[$2], wr_order_number=[$13], wr_return_quantity=[$14], wr_return_amt=[$15]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[web_returns]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3], i_manufact_id=[$5]) + JdbcFilter(condition=[AND(=($4, _UTF-16LE'Sports'), IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($5))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11], i_category=[$12], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcAggregate(group=[{0, 1, 2, 3}], agg#0=[sum($4)], agg#1=[sum($5)]) + JdbcAggregate(group=[{0, 1, 2, 3, 4, 5}]) + JdbcProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], i_manufact_id=[$3], sales_cnt=[$4], sales_amt=[$5]) + JdbcUnion(all=[true]) + JdbcProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], i_manufact_id=[$3], sales_cnt=[$4], sales_amt=[$5]) + JdbcAggregate(group=[{0, 1, 2, 3, 4, 5}]) + JdbcProject(i_brand_id=[$0], i_class_id=[$1], i_category_id=[$2], i_manufact_id=[$3], sales_cnt=[$4], sales_amt=[$5]) + JdbcUnion(all=[true]) + JdbcProject(i_brand_id=[$11], i_class_id=[$12], i_category_id=[$13], i_manufact_id=[$14], sales_cnt=[-($3, CASE(IS NOT NULL($8), $8, 0))], sales_amt=[-($4, CASE(IS NOT NULL($9), $9, 0:DECIMAL(1, 0)))]) + JdbcJoin(condition=[=($10, $1)], joinType=[inner]) + JdbcJoin(condition=[AND(=($2, $7), =($1, $6))], joinType=[left]) + JdbcJoin(condition=[=($5, $0)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$1], cs_order_number=[$2], cs_quantity=[$3], cs_ext_sales_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$15], cs_order_number=[$17], cs_quantity=[$18], cs_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(cr_item_sk=[$0], cr_order_number=[$1], cr_return_quantity=[$2], cr_return_amount=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cr_item_sk=[$2], cr_order_number=[$16], cr_return_quantity=[$17], cr_return_amount=[$18]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3], i_manufact_id=[$5]) + JdbcFilter(condition=[AND(=($4, _UTF-16LE'Sports'), IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($5))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11], i_category=[$12], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(i_brand_id=[$11], i_class_id=[$12], i_category_id=[$13], i_manufact_id=[$14], sales_cnt=[-($3, CASE(IS NOT NULL($8), $8, 0))], sales_amt=[-($4, CASE(IS NOT NULL($9), $9, 0:DECIMAL(1, 0)))]) + JdbcJoin(condition=[=($10, $1)], joinType=[inner]) + JdbcJoin(condition=[AND(=($2, $7), =($1, $6))], joinType=[left]) + JdbcJoin(condition=[=($5, $0)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_ticket_number=[$2], ss_quantity=[$3], ss_ext_sales_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_ticket_number=[$9], ss_quantity=[$10], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(sr_item_sk=[$0], sr_ticket_number=[$1], sr_return_quantity=[$2], sr_return_amt=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(sr_item_sk=[$2], sr_ticket_number=[$9], sr_return_quantity=[$10], sr_return_amt=[$11]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3], i_manufact_id=[$5]) + JdbcFilter(condition=[AND(=($4, _UTF-16LE'Sports'), IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($5))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11], i_category=[$12], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(i_brand_id=[$11], i_class_id=[$12], i_category_id=[$13], i_manufact_id=[$14], sales_cnt=[-($3, CASE(IS NOT NULL($8), $8, 0))], sales_amt=[-($4, CASE(IS NOT NULL($9), $9, 0:DECIMAL(1, 0)))]) + JdbcJoin(condition=[=($10, $1)], joinType=[inner]) + JdbcJoin(condition=[AND(=($2, $7), =($1, $6))], joinType=[left]) + JdbcJoin(condition=[=($5, $0)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_order_number=[$2], ws_quantity=[$3], ws_ext_sales_price=[$4]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_order_number=[$17], ws_quantity=[$18], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(wr_item_sk=[$0], wr_order_number=[$1], wr_return_quantity=[$2], wr_return_amt=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(wr_item_sk=[$2], wr_order_number=[$13], wr_return_quantity=[$14], wr_return_amt=[$15]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[web_returns]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$1], i_class_id=[$2], i_category_id=[$3], i_manufact_id=[$5]) + JdbcFilter(condition=[AND(=($4, _UTF-16LE'Sports'), IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3), IS NOT NULL($5))]) + JdbcProject(i_item_sk=[$0], i_brand_id=[$7], i_class_id=[$9], i_category_id=[$11], i_category=[$12], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query76.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query76.q.out new file mode 100644 index 000000000000..c69e51325f7b --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query76.q.out @@ -0,0 +1,61 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], sort4=[$4], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], fetch=[100]) + HiveProject(channel=[$0], col_name=[$1], d_year=[$2], d_qoy=[$3], i_category=[$4], sales_cnt=[$5], sales_amt=[$6]) + HiveAggregate(group=[{0, 1, 2, 3, 4}], agg#0=[count()], agg#1=[sum($5)]) + HiveProject(channel=[$0], col_name=[$1], d_year=[$2], d_qoy=[$3], i_category=[$4], ext_sales_price=[$5]) + HiveUnion(all=[true]) + HiveProject(channel=[$0], col_name=[$1], d_year=[$2], d_qoy=[$3], i_category=[$4], ext_sales_price=[$5]) + HiveProject(channel=[$0], col_name=[$1], d_year=[$2], d_qoy=[$3], i_category=[$4], ext_sales_price=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(channel=[_UTF-16LE'store':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], col_name=[_UTF-16LE'ss_addr_sk':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], d_year=[$6], d_qoy=[$7], i_category=[$4], ext_sales_price=[$2]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NULL($2), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_addr_sk=[$6], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(i_item_sk=[$0], i_category=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_qoy=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(channel=[$0], col_name=[$1], d_year=[$2], d_qoy=[$3], i_category=[$4], ext_sales_price=[$5]) + HiveProject(channel=[$0], col_name=[$1], d_year=[$2], d_qoy=[$3], i_category=[$4], ext_sales_price=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(channel=[_UTF-16LE'web':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], col_name=[_UTF-16LE'ws_web_page_sk':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], d_year=[$6], d_qoy=[$7], i_category=[$4], ext_sales_price=[$2]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NULL($2), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_web_page_sk=[$12], ws_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(i_item_sk=[$0], i_category=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_qoy=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(channel=[$0], col_name=[$1], d_year=[$2], d_qoy=[$3], i_category=[$4], ext_sales_price=[$5]) + HiveProject(channel=[$0], col_name=[$1], d_year=[$2], d_qoy=[$3], i_category=[$4], ext_sales_price=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(channel=[_UTF-16LE'catalog':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], col_name=[_UTF-16LE'cs_warehouse_sk':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], d_year=[$6], d_qoy=[$7], i_category=[$4], ext_sales_price=[$2]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_item_sk=[$2], cs_ext_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NULL($1), IS NOT NULL($2), IS NOT NULL($0))]) + JdbcProject(cs_sold_date_sk=[$0], cs_warehouse_sk=[$14], cs_item_sk=[$15], cs_ext_sales_price=[$23]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(i_item_sk=[$0], i_category=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_year=[$1], d_qoy=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query77.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query77.q.out new file mode 100644 index 000000000000..e6ecf047dca4 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query77.q.out @@ -0,0 +1,104 @@ +Warning: Shuffle Join MERGEJOIN[38][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 6' is a cross product +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(channel=[$0], id=[$1], sales=[$2], returns=[$3], profit=[$4]) + HiveAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], agg#0=[sum($2)], agg#1=[sum($3)], agg#2=[sum($4)]) + HiveProject(channel=[$0], id=[$1], sales=[$2], returns=[$3], profit=[$4]) + HiveUnion(all=[true]) + HiveProject(channel=[$0], id=[$1], sales=[$2], returns=[$3], profit=[$4]) + HiveProject(channel=[$0], id=[$1], sales=[$2], returns=[$3], profit=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(channel=[_UTF-16LE'store channel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], id=[$0], sales=[$1], returns=[CASE(IS NOT NULL($4), $4, 0:DECIMAL(17, 2))], profit=[-($2, CASE(IS NOT NULL($5), $5, 0:DECIMAL(17, 2)))]) + JdbcJoin(condition=[=($0, $3)], joinType=[left]) + JdbcAggregate(group=[{5}], agg#0=[sum($2)], agg#1=[sum($3)]) + JdbcJoin(condition=[=($1, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$1], ss_ext_sales_price=[$2], ss_net_profit=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$7], ss_ext_sales_price=[$15], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-08-04 00:00:00:TIMESTAMP(9), 1998-09-03 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcAggregate(group=[{5}], agg#0=[sum($2)], agg#1=[sum($3)]) + JdbcJoin(condition=[=($1, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(sr_returned_date_sk=[$0], sr_store_sk=[$1], sr_return_amt=[$2], sr_net_loss=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(sr_returned_date_sk=[$0], sr_store_sk=[$7], sr_return_amt=[$11], sr_net_loss=[$19]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-08-04 00:00:00:TIMESTAMP(9), 1998-09-03 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject(channel=[_UTF-16LE'catalog channel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], id=[$0], sales=[$1], returns=[$3], profit=[-($2, $4)]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(cs_call_center_sk=[$0], $f1=[$1], $f2=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{1}], agg#0=[sum($2)], agg#1=[sum($3)]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_call_center_sk=[$1], cs_ext_sales_price=[$2], cs_net_profit=[$3]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cs_sold_date_sk=[$0], cs_call_center_sk=[$11], cs_ext_sales_price=[$23], cs_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-08-04 00:00:00:TIMESTAMP(9), 1998-09-03 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject($f0=[$0], $f1=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[sum($1)], agg#1=[sum($2)]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(cr_returned_date_sk=[$0], cr_return_amount=[$1], cr_net_loss=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cr_returned_date_sk=[$0], cr_return_amount=[$18], cr_net_loss=[$26]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-08-04 00:00:00:TIMESTAMP(9), 1998-09-03 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(channel=[$0], id=[$1], sales=[$2], returns=[$3], profit=[$4]) + HiveProject(channel=[$0], id=[$1], sales=[$2], returns=[$3], profit=[$4]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(channel=[_UTF-16LE'web channel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], id=[$0], sales=[$1], returns=[CASE(IS NOT NULL($4), $4, 0:DECIMAL(17, 2))], profit=[-($2, CASE(IS NOT NULL($5), $5, 0:DECIMAL(17, 2)))]) + JdbcJoin(condition=[=($0, $3)], joinType=[left]) + JdbcAggregate(group=[{5}], agg#0=[sum($2)], agg#1=[sum($3)]) + JdbcJoin(condition=[=($1, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_web_page_sk=[$1], ws_ext_sales_price=[$2], ws_net_profit=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_web_page_sk=[$12], ws_ext_sales_price=[$23], ws_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-08-04 00:00:00:TIMESTAMP(9), 1998-09-03 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(wp_web_page_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(wp_web_page_sk=[$0]) + JdbcHiveTableScan(table=[[default, web_page]], table:alias=[web_page]) + JdbcAggregate(group=[{5}], agg#0=[sum($2)], agg#1=[sum($3)]) + JdbcJoin(condition=[=($1, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(wr_returned_date_sk=[$0], wr_web_page_sk=[$1], wr_return_amt=[$2], wr_net_loss=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(wr_returned_date_sk=[$0], wr_web_page_sk=[$11], wr_return_amt=[$15], wr_net_loss=[$23]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[web_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-08-04 00:00:00:TIMESTAMP(9), 1998-09-03 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(wp_web_page_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(wp_web_page_sk=[$0]) + JdbcHiveTableScan(table=[[default, web_page]], table:alias=[web_page]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query78.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query78.q.out new file mode 100644 index 000000000000..9530863101a5 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query78.q.out @@ -0,0 +1,73 @@ +CBO PLAN: +HiveProject(ss_sold_year=[CAST(2000):INTEGER], ss_item_sk=[$0], ss_customer_sk=[$1], ratio=[$2], store_qty=[$3], store_wholesale_cost=[$4], store_sales_price=[$5], other_chan_qty=[$6], other_chan_wholesale_cost=[$7], other_chan_sales_price=[$8]) + HiveSortLimit(sort0=[$0], sort1=[$1], sort2=[$9], sort3=[$10], sort4=[$11], sort5=[$6], sort6=[$7], sort7=[$8], sort8=[$12], dir0=[ASC], dir1=[ASC], dir2=[DESC], dir3=[DESC], dir4=[DESC], dir5=[ASC], dir6=[ASC], dir7=[ASC], dir8=[ASC], fetch=[100]) + HiveProject(ss_item_sk=[$0], ss_customer_sk=[$1], ratio=[round(/(CAST($2):DOUBLE, CAST(CASE(AND($12, IS NOT NULL($7)), +($7, $11), 1:BIGINT)):DOUBLE), 2)], store_qty=[$2], store_wholesale_cost=[$3], store_sales_price=[$4], other_chan_qty=[+(CASE(IS NOT NULL($7), $7, 0:BIGINT), $13)], other_chan_wholesale_cost=[+(CASE(IS NOT NULL($8), $8, 0:DECIMAL(17, 2)), $14)], other_chan_sales_price=[+(CASE(IS NOT NULL($9), $9, 0:DECIMAL(17, 2)), $15)], ss_qty=[$2], ss_wc=[$3], ss_sp=[$4], (tok_function round (/ (tok_table_or_col ss_qty) (tok_function coalesce (+ (tok_table_or_col ws_qty) (tok_table_or_col cs_qty)) 1)) 2)=[round(/(CAST($2):DOUBLE, CAST(CASE(AND($12, IS NOT NULL($7)), +($7, $11), 1:BIGINT)):DOUBLE), 2)]) + HiveJoin(condition=[=($10, $1)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[AND(=($6, $1), =($5, $0))], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ss_item_sk=[$0], ss_customer_sk=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + HiveAggregate(group=[{1, 2}], agg#0=[sum($3)], agg#1=[sum($4)], agg#2=[sum($5)]) + HiveJoin(condition=[=($0, $6)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2], ss_quantity=[$4], ss_wholesale_cost=[$5], ss_sales_price=[$6]) + HiveAntiJoin(condition=[AND(=($1, $7), =($8, $3))], joinType=[anti]) + HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2], ss_ticket_number=[$3], ss_quantity=[$4], ss_wholesale_cost=[$5], ss_sales_price=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_customer_sk=[$3], ss_ticket_number=[$9], ss_quantity=[$10], ss_wholesale_cost=[$11], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(sr_item_sk=[$0], sr_ticket_number=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(sr_item_sk=[$2], sr_ticket_number=[$9]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + HiveProject(d_date_sk=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(ws_item_sk=[$0], ws_bill_customer_sk=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + HiveFilter(condition=[>($2, 0)]) + HiveAggregate(group=[{1, 2}], agg#0=[sum($3)], agg#1=[sum($4)], agg#2=[sum($5)]) + HiveJoin(condition=[=($0, $6)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_customer_sk=[$2], ws_quantity=[$4], ws_wholesale_cost=[$5], ws_sales_price=[$6]) + HiveAntiJoin(condition=[AND(=($1, $7), =($8, $3))], joinType=[anti]) + HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_bill_customer_sk=[$2], ws_order_number=[$3], ws_quantity=[$4], ws_wholesale_cost=[$5], ws_sales_price=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_bill_customer_sk=[$4], ws_order_number=[$17], ws_quantity=[$18], ws_wholesale_cost=[$19], ws_sales_price=[$21]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + HiveProject(wr_item_sk=[$0], wr_order_number=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(wr_item_sk=[$2], wr_order_number=[$13]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[web_returns]) + HiveProject(d_date_sk=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject($f2=[$1], $f3=[$2], EXPR$0=[IS NOT NULL($2)], EXPR$1=[CASE(IS NOT NULL($2), $2, 0:BIGINT)], EXPR$2=[CASE(IS NOT NULL($3), $3, 0:DECIMAL(17, 2))], EXPR$3=[CASE(IS NOT NULL($4), $4, 0:DECIMAL(17, 2))]) + HiveFilter(condition=[>($2, 0)]) + HiveProject(cs_item_sk=[$1], cs_bill_customer_sk=[$0], $f2=[$2], $f3=[$3], $f4=[$4]) + HiveAggregate(group=[{1, 2}], agg#0=[sum($3)], agg#1=[sum($4)], agg#2=[sum($5)]) + HiveJoin(condition=[=($0, $6)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2], cs_quantity=[$4], cs_wholesale_cost=[$5], cs_sales_price=[$6]) + HiveAntiJoin(condition=[AND(=($2, $7), =($8, $3))], joinType=[anti]) + HiveProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2], cs_order_number=[$3], cs_quantity=[$4], cs_wholesale_cost=[$5], cs_sales_price=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], cs_item_sk=[$15], cs_order_number=[$17], cs_quantity=[$18], cs_wholesale_cost=[$19], cs_sales_price=[$21]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + HiveProject(cr_item_sk=[$0], cr_order_number=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cr_item_sk=[$2], cr_order_number=[$16]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + HiveProject(d_date_sk=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query79.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query79.q.out new file mode 100644 index 000000000000..2c1664ce9a4e --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query79.q.out @@ -0,0 +1,34 @@ +CBO PLAN: +HiveProject(c_last_name=[$0], c_first_name=[$1], _c2=[$2], ss_ticket_number=[$3], amt=[$4], profit=[$5]) + HiveSortLimit(sort0=[$0], sort1=[$1], sort2=[$6], sort3=[$5], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], fetch=[100]) + HiveProject(c_last_name=[$7], c_first_name=[$6], _o__c2=[$4], ss_ticket_number=[$0], amt=[$2], profit=[$3], (tok_function substr (tok_table_or_col s_city) 1 30)=[$4]) + HiveJoin(condition=[=($1, $5)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ss_ticket_number=[$2], ss_customer_sk=[$0], amt=[$4], profit=[$5], _o__c2=[substr($3, 1, 30)]) + HiveProject(ss_customer_sk=[$0], ss_addr_sk=[$1], ss_ticket_number=[$2], s_city=[$3], $f4=[$4], $f5=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{1, 3, 5, 11}], agg#0=[sum($6)], agg#1=[sum($7)]) + JdbcJoin(condition=[=($4, $10)], joinType=[inner]) + JdbcJoin(condition=[=($2, $9)], joinType=[inner]) + JdbcJoin(condition=[=($0, $8)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1], ss_hdemo_sk=[$2], ss_addr_sk=[$3], ss_store_sk=[$4], ss_ticket_number=[$5], ss_coupon_amt=[$6], ss_net_profit=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($4), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3], ss_hdemo_sk=[$5], ss_addr_sk=[$6], ss_store_sk=[$7], ss_ticket_number=[$9], ss_coupon_amt=[$19], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(IN($1, 1998, 1999, 2000), =($2, 1), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_dow=[$7]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(OR(=($1, 8), >($2, 0)), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(s_store_sk=[$0], s_city=[$2]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 200, 295), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_number_employees=[$6], s_city=[$22]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject(c_customer_sk=[$0], c_first_name=[$1], c_last_name=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query8.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query8.q.out new file mode 100644 index 000000000000..9a4ee8a88ffd --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query8.q.out @@ -0,0 +1,57 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], dir0=[ASC], fetch=[100]) + HiveProject(s_store_name=[$0], _c1=[$1]) + HiveAggregate(group=[{5}], agg#0=[sum($2)]) + HiveJoin(condition=[=($1, $4)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ss_sold_date_sk=[$0], ss_store_sk=[$1], ss_net_profit=[$2], d_date_sk=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$1], ss_net_profit=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_store_sk=[$7], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($2, 1), =($1, 2002), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_qoy=[$10]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveJoin(condition=[=($2, $3)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(s_store_sk=[$0], s_store_name=[$1], EXPR$0=[substr($2, 1, 2)]) + HiveFilter(condition=[IS NOT NULL(substr($2, 1, 2))]) + HiveProject(s_store_sk=[$0], s_store_name=[$1], s_zip=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5], s_zip=[$25]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject(EXPR$0=[substr($0, 1, 2)]) + HiveFilter(condition=[=($1, 2)]) + HiveAggregate(group=[{0}], agg#0=[count($1)]) + HiveProject($f0=[$0], $f1=[$1]) + HiveUnion(all=[true]) + HiveProject($f0=[$0], $f1=[$1]) + HiveAggregate(group=[{0}], agg#0=[count()]) + HiveProject($f0=[substr($0, 1, 5)]) + HiveFilter(condition=[AND(IN(substr($0, 1, 5), _UTF-16LE'89436':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'30868':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'65085':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'22977':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'83927':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'77557':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'58429':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'40697':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'80614':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'10502':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'32779':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'91137':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'61265':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'98294':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'17921':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'18427':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21203':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'59362':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'87291':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'84093':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21505':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'17184':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'10866':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'67898':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'25797':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'28055':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'18377':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'80332':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'74535':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21757':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'29742':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'90885':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'29898':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'17819':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'40811':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'25990':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'47513':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'89531':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'91068':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'10391':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'18846':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'99223':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'82637':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'41368':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'83658':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'86199':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'81625':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'26696':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'89338':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'88425':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'32200':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'81427':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'19053':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'77471':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'36610':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'99823':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'43276':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'41249':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'48584':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'83550':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'82276':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'18842':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'78890':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'14090':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'38123':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'40936':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'34425':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'19850':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'43286':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'80072':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'79188':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'54191':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'11395':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'50497':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'84861':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'90733':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21068':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'57666':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'37119':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'25004':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'57835':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'70067':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'62878':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'95806':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'19303':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'18840':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'19124':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'29785':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'16737':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'16022':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'49613':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'89977':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'68310':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'60069':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'98360':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'48649':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'39050':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'41793':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'25002':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'27413':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'39736':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'47208':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'16515':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'94808':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'57648':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'15009':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'80015':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'42961':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'63982':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21744':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'71853':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'81087':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'67468':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'34175':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'64008':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'20261':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'11201':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'51799':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'48043':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'45645':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'61163':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'48375':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'36447':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'57042':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21218':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'41100':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'89951':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'22745':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'35851':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'83326':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'61125':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'78298':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'80752':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'49858':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'52940':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'96976':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'63792':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'11376':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'53582':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'18717':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'90226':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'50530':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'94203':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'99447':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'27670':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'96577':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'57856':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'56372':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'16165':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'23427':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'54561':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'28806':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'44439':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'22926':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'30123':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'61451':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'92397':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'56979':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'92309':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'70873':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'13355':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21801':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'46346':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'37562':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'56458':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'28286':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'47306':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'99555':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'69399':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'26234':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'47546':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'49661':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'88601':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'35943':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'39936':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'25632':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'24611':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'44166':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'56648':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'30379':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'59785':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'11110':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'14329':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'93815':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'52226':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'71381':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'13842':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'25612':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'63294':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'14664':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21077':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'82626':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'18799':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'60915':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'81020':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'56447':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'76619':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'11433':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'13414':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'42548':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'92713':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'70467':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'30884':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'47484':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'16072':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'38936':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'13036':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'88376':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'45539':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'35901':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'19506':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'65690':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'73957':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'71850':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'49231':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'14276':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'20005':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'18384':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'76615':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'11635':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'38177':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'55607':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'41369':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'95447':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'58581':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'58149':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'91946':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'33790':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'76232':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'75692':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'95464':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'22246':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'51061':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'56692':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'53121':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'77209':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'15482':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'10688':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'14868':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'45907':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'73520':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'72666':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'25734':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'17959':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'24677':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'66446':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'94627':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'53535':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'15560':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'41967':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'69297':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'11929':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'59403':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'33283':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'52232':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'57350':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'43933':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'40921':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'36635':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'10827':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'71286':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'19736':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'80619':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'25251':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'95042':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'15526':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'36496':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'55854':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'49124':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'81980':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'35375':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'49157':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'63512':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'28944':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'14946':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'36503':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'54010':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'18767':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'23969':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'43905':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'66979':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'33113':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21286':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'58471':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'59080':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'13395':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'79144':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'70373':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'67031':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'38360':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'26705':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'50906':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'52406':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'26066':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'73146':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'15884':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'31897':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'30045':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'61068':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'45550':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'92454':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'13376':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'14354':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'19770':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'22928':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'97790':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'50723':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'46081':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'30202':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'14410':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'20223':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'88500':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'67298':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'13261':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'14172':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'81410':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'93578':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'83583':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'46047':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'94167':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'82564':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21156':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'15799':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'86709':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'37931':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'74703':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'83103':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'23054':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'70470':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'72008':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'49247':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'91911':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'69998':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'20961':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'70070':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'63197':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'54853':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'88191':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'91830':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'49521':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'19454':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'81450':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'89091':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'62378':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'25683':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'61869':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'51744':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'36580':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'85778':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'36871':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'48121':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'28810':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'83712':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'45486':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'67393':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'26935':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'42393':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'20132':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'55349':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'86057':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21309':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'80218':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'10094':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'11357':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'48819':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'39734':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'40758':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'30432':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21204':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'29467':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'30214':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'61024':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'55307':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'74621':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'11622':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'68908':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'33032':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'52868':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'99194':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'99900':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'84936':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'69036':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'99149':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'45013':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'32895':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'59004':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'32322':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'14933':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'32936':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'33562':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'72550':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'27385':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'58049':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'58200':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'16808':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'21360':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'32961':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'18586':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'79307':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'15492':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL(substr(substr($0, 1, 5), 1, 2)))]) + HiveProject(ca_zip=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ca_zip=[$9]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + HiveProject($f0=[$0], $f1=[$1]) + HiveAggregate(group=[{0}], agg#0=[count()]) + HiveProject($f0=[substr($0, 1, 5)]) + HiveFilter(condition=[>($1, 10)]) + HiveAggregate(group=[{1}], agg#0=[count()]) + HiveJoin(condition=[=($0, $2)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(ca_address_sk=[$0], ca_zip=[$1]) + HiveFilter(condition=[IS NOT NULL(substr(substr($1, 1, 5), 1, 2))]) + HiveProject(ca_address_sk=[$0], ca_zip=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ca_address_sk=[$0], ca_zip=[$9]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + HiveProject(c_current_addr_sk=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(c_current_addr_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'Y'), IS NOT NULL($0))]) + JdbcProject(c_current_addr_sk=[$4], c_preferred_cust_flag=[$10]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query80.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query80.q.out new file mode 100644 index 000000000000..84562be439bc --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query80.q.out @@ -0,0 +1,109 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(channel=[$0], id=[$1], sales=[$2], returns=[$3], profit=[$4]) + HiveAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], agg#0=[sum($2)], agg#1=[sum($3)], agg#2=[sum($4)]) + HiveProject(channel=[$0], id=[$1], sales=[$2], returns=[$3], profit=[$4]) + HiveUnion(all=[true]) + HiveProject(channel=[_UTF-16LE'store channel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], id=[||(_UTF-16LE'store':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", $0)], sales=[$1], returns=[$2], profit=[$3]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{0}], agg#0=[sum($1)], agg#1=[sum($2)], agg#2=[sum($3)]) + JdbcProject($f0=[$15], $f1=[$5], $f2=[CASE(IS NOT NULL($9), $9, 0:DECIMAL(12, 2))], $f3=[-($6, CASE(IS NOT NULL($10), $10, 0:DECIMAL(12, 2)))]) + JdbcJoin(condition=[=($2, $14)], joinType=[inner]) + JdbcJoin(condition=[=($3, $13)], joinType=[inner]) + JdbcJoin(condition=[=($1, $12)], joinType=[inner]) + JdbcJoin(condition=[=($0, $11)], joinType=[inner]) + JdbcJoin(condition=[AND(=($1, $7), =($4, $8))], joinType=[left]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_store_sk=[$2], ss_promo_sk=[$3], ss_ticket_number=[$4], ss_ext_sales_price=[$5], ss_net_profit=[$6]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($3))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_store_sk=[$7], ss_promo_sk=[$8], ss_ticket_number=[$9], ss_ext_sales_price=[$15], ss_net_profit=[$22]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(sr_item_sk=[$0], sr_ticket_number=[$1], sr_return_amt=[$2], sr_net_loss=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(sr_item_sk=[$2], sr_ticket_number=[$9], sr_return_amt=[$11], sr_net_loss=[$19]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-08-04 00:00:00:TIMESTAMP(9), 1998-09-03 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0]) + JdbcFilter(condition=[AND(>($1, 50:DECIMAL(2, 0)), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_current_price=[$5]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(p_promo_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'N'), IS NOT NULL($0))]) + JdbcProject(p_promo_sk=[$0], p_channel_tv=[$11]) + JdbcHiveTableScan(table=[[default, promotion]], table:alias=[promotion]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0], s_store_id=[$1]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject(channel=[_UTF-16LE'catalog channel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], id=[||(_UTF-16LE'catalog_page':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", $0)], sales=[$1], returns=[$2], profit=[$3]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{0}], agg#0=[sum($1)], agg#1=[sum($2)], agg#2=[sum($3)]) + JdbcProject($f0=[$15], $f1=[$5], $f2=[CASE(IS NOT NULL($9), $9, 0:DECIMAL(12, 2))], $f3=[-($6, CASE(IS NOT NULL($10), $10, 0:DECIMAL(12, 2)))]) + JdbcJoin(condition=[=($1, $14)], joinType=[inner]) + JdbcJoin(condition=[=($3, $13)], joinType=[inner]) + JdbcJoin(condition=[=($2, $12)], joinType=[inner]) + JdbcJoin(condition=[=($0, $11)], joinType=[inner]) + JdbcJoin(condition=[AND(=($2, $7), =($4, $8))], joinType=[left]) + JdbcProject(cs_sold_date_sk=[$0], cs_catalog_page_sk=[$1], cs_item_sk=[$2], cs_promo_sk=[$3], cs_order_number=[$4], cs_ext_sales_price=[$5], cs_net_profit=[$6]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($3))]) + JdbcProject(cs_sold_date_sk=[$0], cs_catalog_page_sk=[$12], cs_item_sk=[$15], cs_promo_sk=[$16], cs_order_number=[$17], cs_ext_sales_price=[$23], cs_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(cr_item_sk=[$0], cr_order_number=[$1], cr_return_amount=[$2], cr_net_loss=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cr_item_sk=[$2], cr_order_number=[$16], cr_return_amount=[$18], cr_net_loss=[$26]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-08-04 00:00:00:TIMESTAMP(9), 1998-09-03 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0]) + JdbcFilter(condition=[AND(>($1, 50:DECIMAL(2, 0)), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_current_price=[$5]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(p_promo_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'N'), IS NOT NULL($0))]) + JdbcProject(p_promo_sk=[$0], p_channel_tv=[$11]) + JdbcHiveTableScan(table=[[default, promotion]], table:alias=[promotion]) + JdbcProject(cp_catalog_page_sk=[$0], cp_catalog_page_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cp_catalog_page_sk=[$0], cp_catalog_page_id=[$1]) + JdbcHiveTableScan(table=[[default, catalog_page]], table:alias=[catalog_page]) + HiveProject(channel=[_UTF-16LE'web channel':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], id=[||(_UTF-16LE'web_site':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", $0)], sales=[$1], returns=[$2], profit=[$3]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{0}], agg#0=[sum($1)], agg#1=[sum($2)], agg#2=[sum($3)]) + JdbcProject($f0=[$15], $f1=[$5], $f2=[CASE(IS NOT NULL($9), $9, 0:DECIMAL(12, 2))], $f3=[-($6, CASE(IS NOT NULL($10), $10, 0:DECIMAL(12, 2)))]) + JdbcJoin(condition=[=($2, $14)], joinType=[inner]) + JdbcJoin(condition=[=($3, $13)], joinType=[inner]) + JdbcJoin(condition=[=($1, $12)], joinType=[inner]) + JdbcJoin(condition=[=($0, $11)], joinType=[inner]) + JdbcJoin(condition=[AND(=($1, $7), =($4, $8))], joinType=[left]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_web_site_sk=[$2], ws_promo_sk=[$3], ws_order_number=[$4], ws_ext_sales_price=[$5], ws_net_profit=[$6]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($3))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_web_site_sk=[$13], ws_promo_sk=[$16], ws_order_number=[$17], ws_ext_sales_price=[$23], ws_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(wr_item_sk=[$0], wr_order_number=[$1], wr_return_amt=[$2], wr_net_loss=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(wr_item_sk=[$2], wr_order_number=[$13], wr_return_amt=[$15], wr_net_loss=[$23]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[web_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-08-04 00:00:00:TIMESTAMP(9), 1998-09-03 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0]) + JdbcFilter(condition=[AND(>($1, 50:DECIMAL(2, 0)), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_current_price=[$5]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(p_promo_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'N'), IS NOT NULL($0))]) + JdbcProject(p_promo_sk=[$0], p_channel_tv=[$11]) + JdbcHiveTableScan(table=[[default, promotion]], table:alias=[promotion]) + JdbcProject(web_site_sk=[$0], web_site_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(web_site_sk=[$0], web_site_id=[$1]) + JdbcHiveTableScan(table=[[default, web_site]], table:alias=[web_site]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query81.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query81.q.out new file mode 100644 index 000000000000..d3b3e910faea --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query81.q.out @@ -0,0 +1,55 @@ +CBO PLAN: +HiveProject(c_customer_id=[$0], c_salutation=[$1], c_first_name=[$2], c_last_name=[$3], ca_street_number=[$4], ca_street_name=[$5], ca_street_type=[$6], ca_suite_number=[$7], ca_city=[$8], ca_county=[$9], ca_state=[$10], ca_zip=[$11], ca_country=[$12], ca_gmt_offset=[$13], ca_location_type=[$14], ctr_total_return=[$15]) + HiveProject(c_customer_id=[$0], c_salutation=[$1], c_first_name=[$2], c_last_name=[$3], ca_street_number=[$4], ca_street_name=[$5], ca_street_type=[$6], ca_suite_number=[$7], ca_city=[$8], ca_county=[$9], ca_state=[$10], ca_zip=[$11], ca_country=[$12], ca_gmt_offset=[$13], ca_location_type=[$14], ctr_total_return=[$15]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(c_customer_id=[$0], c_salutation=[$1], c_first_name=[$2], c_last_name=[$3], ca_street_number=[$4], ca_street_name=[$5], ca_street_type=[$6], ca_suite_number=[$7], ca_city=[$8], ca_county=[$9], ca_state=[CAST(_UTF-16LE'IL':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"):VARCHAR(2147483647) CHARACTER SET "UTF-16LE"], ca_zip=[$10], ca_country=[$11], ca_gmt_offset=[$12], ca_location_type=[$13], ctr_total_return=[$14]) + JdbcSort(sort0=[$0], sort1=[$1], sort2=[$2], sort3=[$3], sort4=[$4], sort5=[$5], sort6=[$6], sort7=[$7], sort8=[$8], sort9=[$9], sort10=[$10], sort11=[$11], sort12=[$12], sort13=[$13], sort14=[$14], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC], dir5=[ASC], dir6=[ASC], dir7=[ASC], dir8=[ASC], dir9=[ASC], dir10=[ASC], dir11=[ASC], dir12=[ASC], dir13=[ASC], dir14=[ASC], fetch=[100]) + JdbcProject(c_customer_id=[$12], c_salutation=[$14], c_first_name=[$15], c_last_name=[$16], ca_street_number=[$1], ca_street_name=[$2], ca_street_type=[$3], ca_suite_number=[$4], ca_city=[$5], ca_county=[$6], ca_zip=[$7], ca_country=[$8], ca_gmt_offset=[$9], ca_location_type=[$10], ctr_total_return=[$19]) + JdbcJoin(condition=[=($17, $11)], joinType=[inner]) + JdbcJoin(condition=[=($0, $13)], joinType=[inner]) + JdbcProject(ca_address_sk=[$0], ca_street_number=[$1], ca_street_name=[$2], ca_street_type=[$3], ca_suite_number=[$4], ca_city=[$5], ca_county=[$6], ca_zip=[$8], ca_country=[$9], ca_gmt_offset=[$10], ca_location_type=[$11]) + JdbcFilter(condition=[AND(=($7, _UTF-16LE'IL'), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_street_number=[$2], ca_street_name=[$3], ca_street_type=[$4], ca_suite_number=[$5], ca_city=[$6], ca_county=[$7], ca_state=[$8], ca_zip=[$9], ca_country=[$10], ca_gmt_offset=[$11], ca_location_type=[$12]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_current_addr_sk=[$2], c_salutation=[$3], c_first_name=[$4], c_last_name=[$5]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0))]) + JdbcProject(c_customer_sk=[$0], c_customer_id=[$1], c_current_addr_sk=[$4], c_salutation=[$7], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(cr_returning_customer_sk=[$0], ca_state=[$1], $f2=[$2], _o__c0=[$3], ctr_state=[$4]) + JdbcJoin(condition=[AND(=($1, $4), >($2, $3))], joinType=[inner]) + JdbcProject(cr_returning_customer_sk=[$0], ca_state=[$1], $f2=[$2]) + JdbcFilter(condition=[IS NOT NULL($2)]) + JdbcAggregate(group=[{1, 6}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(cr_returned_date_sk=[$0], cr_returning_customer_sk=[$1], cr_returning_addr_sk=[$2], cr_return_amt_inc_tax=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(cr_returned_date_sk=[$0], cr_returning_customer_sk=[$7], cr_returning_addr_sk=[$10], cr_return_amt_inc_tax=[$20]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1998), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_state=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(_o__c0=[*(CAST(/($1, $2)):DECIMAL(21, 6), 1.2:DECIMAL(2, 1))], ctr_state=[$0]) + JdbcFilter(condition=[IS NOT NULL(CAST(/($1, $2)):DECIMAL(21, 6))]) + JdbcAggregate(group=[{1}], agg#0=[sum($2)], agg#1=[count($2)]) + JdbcAggregate(group=[{1, 6}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(cr_returned_date_sk=[$0], cr_returning_customer_sk=[$1], cr_returning_addr_sk=[$2], cr_return_amt_inc_tax=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(cr_returned_date_sk=[$0], cr_returning_customer_sk=[$7], cr_returning_addr_sk=[$10], cr_return_amt_inc_tax=[$20]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1998), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_state=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query82.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query82.q.out new file mode 100644 index 000000000000..a680bc160125 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query82.q.out @@ -0,0 +1,27 @@ +CBO PLAN: +HiveProject(i_item_id=[$0], i_item_desc=[$1], i_current_price=[$2]) + HiveProject(i_item_id=[$0], i_item_desc=[$1], i_current_price=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$0], dir0=[ASC], fetch=[100]) + JdbcAggregate(group=[{1, 2, 3}]) + JdbcJoin(condition=[=($6, $0)], joinType=[inner]) + JdbcJoin(condition=[=($4, $0)], joinType=[inner]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$2], i_current_price=[$3]) + JdbcFilter(condition=[AND(IN($4, 129, 437, 663, 727), BETWEEN(false, $3, 30:DECIMAL(12, 2), 60:DECIMAL(12, 2)), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$4], i_current_price=[$5], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(ss_item_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ss_item_sk=[$2]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(inv_date_sk=[$0], inv_item_sk=[$1], d_date_sk=[$2]) + JdbcJoin(condition=[=($2, $0)], joinType=[inner]) + JdbcProject(inv_date_sk=[$0], inv_item_sk=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 100, 500), IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(inv_date_sk=[$0], inv_item_sk=[$1], inv_quantity_on_hand=[$3]) + JdbcHiveTableScan(table=[[default, inventory]], table:alias=[inventory]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 2002-05-30 00:00:00:TIMESTAMP(9), 2002-07-29 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query83.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query83.q.out new file mode 100644 index 000000000000..b11a1a21c2f8 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query83.q.out @@ -0,0 +1,114 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(sr_items.item_id=[$0], sr_item_qty=[$1], sr_dev=[*(/(/($2, CAST(+(+($1, $4), $7)):DOUBLE), 3), 100)], cr_item_qty=[$4], cr_dev=[*(/(/($5, CAST(+(+($1, $4), $7)):DOUBLE), 3), 100)], wr_item_qty=[$7], wr_dev=[*(/(/($8, CAST(+(+($1, $4), $7)):DOUBLE), 3), 100)], average=[/(CAST(+(+($1, $4), $7)):DECIMAL(19, 0), 3:DECIMAL(1, 0))]) + HiveJoin(condition=[=($0, $6)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($0, $3)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject($f0=[$0], $f1=[$1], EXPR$0=[CAST($1):DOUBLE]) + HiveAggregate(group=[{4}], agg#0=[sum($2)]) + HiveSemiJoin(condition=[=($6, $7)], joinType=[semi]) + HiveProject(sr_returned_date_sk=[$0], sr_item_sk=[$1], sr_return_quantity=[$2], i_item_sk=[$3], i_item_id=[$4], d_date_sk=[$5], d_date=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$1], sr_return_quantity=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(sr_returned_date_sk=[$0], sr_item_sk=[$2], sr_return_quantity=[$10]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(d_date=[$0]) + HiveSemiJoin(condition=[=($1, $2)], joinType=[semi]) + HiveProject(d_date=[$0], d_week_seq=[$1]) + HiveProject(d_date=[$0], d_week_seq=[$1]) + HiveProject(d_date=[$0], d_week_seq=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(d_date=[$2], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(d_week_seq=[$0]) + HiveProject(d_week_seq=[$0]) + HiveProject(d_week_seq=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(d_week_seq=[$1]) + JdbcFilter(condition=[AND(IN($0, _UTF-16LE'1998-01-02':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'1998-10-15':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'1998-11-10':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($1))]) + JdbcProject(d_date=[$2], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject($f0=[$0], $f1=[$1], EXPR$2=[CAST($1):DOUBLE]) + HiveAggregate(group=[{4}], agg#0=[sum($2)]) + HiveSemiJoin(condition=[=($6, $7)], joinType=[semi]) + HiveProject(cr_returned_date_sk=[$0], cr_item_sk=[$1], cr_return_quantity=[$2], i_item_sk=[$3], i_item_id=[$4], d_date_sk=[$5], d_date=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(cr_returned_date_sk=[$0], cr_item_sk=[$1], cr_return_quantity=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(cr_returned_date_sk=[$0], cr_item_sk=[$2], cr_return_quantity=[$17]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(d_date=[$0]) + HiveSemiJoin(condition=[=($1, $2)], joinType=[semi]) + HiveProject(d_date=[$0], d_week_seq=[$1]) + HiveProject(d_date=[$0], d_week_seq=[$1]) + HiveProject(d_date=[$0], d_week_seq=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(d_date=[$2], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(d_week_seq=[$0]) + HiveProject(d_week_seq=[$0]) + HiveProject(d_week_seq=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(d_week_seq=[$1]) + JdbcFilter(condition=[AND(IN($0, _UTF-16LE'1998-01-02':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'1998-10-15':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'1998-11-10':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($1))]) + JdbcProject(d_date=[$2], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject($f0=[$0], $f1=[$1], EXPR$0=[CAST($1):DOUBLE]) + HiveAggregate(group=[{4}], agg#0=[sum($2)]) + HiveSemiJoin(condition=[=($6, $7)], joinType=[semi]) + HiveProject(wr_returned_date_sk=[$0], wr_item_sk=[$1], wr_return_quantity=[$2], i_item_sk=[$3], i_item_id=[$4], d_date_sk=[$5], d_date=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(wr_returned_date_sk=[$0], wr_item_sk=[$1], wr_return_quantity=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(wr_returned_date_sk=[$0], wr_item_sk=[$2], wr_return_quantity=[$14]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[web_returns]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(d_date=[$0]) + HiveSemiJoin(condition=[=($1, $2)], joinType=[semi]) + HiveProject(d_date=[$0], d_week_seq=[$1]) + HiveProject(d_date=[$0], d_week_seq=[$1]) + HiveProject(d_date=[$0], d_week_seq=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(d_date=[$2], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(d_week_seq=[$0]) + HiveProject(d_week_seq=[$0]) + HiveProject(d_week_seq=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(d_week_seq=[$1]) + JdbcFilter(condition=[AND(IN($0, _UTF-16LE'1998-01-02':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'1998-10-15':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'1998-11-10':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($1))]) + JdbcProject(d_date=[$2], d_week_seq=[$4]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query84.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query84.q.out new file mode 100644 index 000000000000..f50e3d3c8c53 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query84.q.out @@ -0,0 +1,41 @@ +CBO PLAN: +HiveProject(customer_id=[$0], customername=[$1]) + HiveSortLimit(sort0=[$2], dir0=[ASC], fetch=[100]) + HiveProject(customer_id=[$0], customername=[$4], c_customer_id=[$0]) + HiveJoin(condition=[=($8, $2)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($6, $1)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($3, $5)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(c_customer_id=[$0], c_current_cdemo_sk=[$1], c_current_hdemo_sk=[$2], c_current_addr_sk=[$3], customername=[||(||($5, _UTF-16LE', ':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), $4)]) + HiveProject(c_customer_id=[$0], c_current_cdemo_sk=[$1], c_current_hdemo_sk=[$2], c_current_addr_sk=[$3], c_first_name=[$4], c_last_name=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(c_customer_id=[$1], c_current_cdemo_sk=[$2], c_current_hdemo_sk=[$3], c_current_addr_sk=[$4], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + HiveProject(ca_address_sk=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ca_address_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'Hopewell'), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_city=[$6]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + HiveProject(cd_demo_sk=[$0], sr_cdemo_sk=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($1, $0)], joinType=[inner]) + JdbcProject(cd_demo_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cd_demo_sk=[$0]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[customer_demographics]) + JdbcProject(sr_cdemo_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(sr_cdemo_sk=[$4]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + HiveProject(hd_demo_sk=[$0], hd_income_band_sk=[$1], ib_income_band_sk=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($2, $1)], joinType=[inner]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(hd_demo_sk=[$0], hd_income_band_sk=[$1]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(ib_income_band_sk=[$0]) + JdbcFilter(condition=[AND(>=($1, 32287), <=($2, 82287), IS NOT NULL($0))]) + JdbcHiveTableScan(table=[[default, income_band]], table:alias=[income_band]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query85.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query85.q.out new file mode 100644 index 000000000000..f2596d2c7891 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query85.q.out @@ -0,0 +1,48 @@ +CBO PLAN: +HiveProject(_c0=[$0], _c1=[$1], _c2=[$2], _c3=[$3]) + HiveSortLimit(sort0=[$7], sort1=[$4], sort2=[$5], sort3=[$6], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], fetch=[100]) + HiveProject(_o__c0=[substr($0, 1, 20)], _o__c1=[/(CAST($1):DOUBLE, $2)], _o__c2=[CAST(/($3, $4)):DECIMAL(11, 6)], _o__c3=[CAST(/($5, $6)):DECIMAL(11, 6)], (tok_function avg (tok_table_or_col ws_quantity))=[/(CAST($1):DOUBLE, $2)], (tok_function avg (tok_table_or_col wr_refunded_cash))=[CAST(/($3, $4)):DECIMAL(11, 6)], (tok_function avg (tok_table_or_col wr_fee))=[CAST(/($5, $6)):DECIMAL(11, 6)], (tok_function substr (tok_table_or_col r_reason_desc) 1 20)=[substr($0, 1, 20)]) + HiveProject(r_reason_desc=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4], $f5=[$5], $f6=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{9}], agg#0=[sum($30)], agg#1=[count($30)], agg#2=[sum($7)], agg#3=[count($7)], agg#4=[sum($6)], agg#5=[count($6)]) + JdbcJoin(condition=[AND(=($27, $0), =($29, $5), OR(AND($17, $18, $34), AND($19, $20, $35), AND($21, $22, $36)), OR(AND($11, $31), AND($12, $32), AND($13, $33)))], joinType=[inner]) + JdbcJoin(condition=[AND(=($23, $3), =($15, $24), =($16, $25))], joinType=[inner]) + JdbcJoin(condition=[=($14, $1)], joinType=[inner]) + JdbcJoin(condition=[=($10, $2)], joinType=[inner]) + JdbcJoin(condition=[=($8, $4)], joinType=[inner]) + JdbcProject(wr_item_sk=[$0], wr_refunded_cdemo_sk=[$1], wr_refunded_addr_sk=[$2], wr_returning_cdemo_sk=[$3], wr_reason_sk=[$4], wr_order_number=[$5], wr_fee=[$6], wr_refunded_cash=[$7]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($5), IS NOT NULL($1), IS NOT NULL($3), IS NOT NULL($2), IS NOT NULL($4))]) + JdbcProject(wr_item_sk=[$2], wr_refunded_cdemo_sk=[$4], wr_refunded_addr_sk=[$6], wr_returning_cdemo_sk=[$8], wr_reason_sk=[$12], wr_order_number=[$13], wr_fee=[$18], wr_refunded_cash=[$20]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[web_returns]) + JdbcProject(r_reason_sk=[$0], r_reason_desc=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(r_reason_sk=[$0], r_reason_desc=[$2]) + JdbcHiveTableScan(table=[[default, reason]], table:alias=[reason]) + JdbcProject(ca_address_sk=[$0], EXPR$0=[IN($1, _UTF-16LE'GA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'KY':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'NM':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")], EXPR$1=[IN($1, _UTF-16LE'IN':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MT':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'OR':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")], EXPR$2=[IN($1, _UTF-16LE'MO':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'WI':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'WV':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'GA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'IN':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'KY':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MO':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MT':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'NM':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'OR':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'WI':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'WV':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), =($2, _UTF-16LE'United States'), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8], ca_country=[$10]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$1], cd_education_status=[$2], EXPR$0=[=($1, _UTF-16LE'M')], EXPR$1=[=($2, _UTF-16LE'4 yr Degree')], EXPR$2=[=($1, _UTF-16LE'D')], EXPR$3=[=($2, _UTF-16LE'Primary')], EXPR$4=[=($1, _UTF-16LE'U')], EXPR$5=[=($2, _UTF-16LE'Advanced Degree')]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'D':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'M':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'U':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'4 yr Degree':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Advanced Degree':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Primary':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$2], cd_education_status=[$3]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[cd1]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$1], cd_education_status=[$2]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'D':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'M':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'U':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'4 yr Degree':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Advanced Degree':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Primary':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$2], cd_education_status=[$3]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[cd2]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_web_page_sk=[$2], ws_order_number=[$3], ws_quantity=[$4], EXPR$0=[$5], EXPR$1=[$6], EXPR$2=[$7], EXPR$3=[$8], EXPR$4=[$9], EXPR$5=[$10], wp_web_page_sk=[$11], d_date_sk=[$12]) + JdbcJoin(condition=[=($0, $12)], joinType=[inner]) + JdbcJoin(condition=[=($2, $11)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_web_page_sk=[$2], ws_order_number=[$3], ws_quantity=[$4], EXPR$0=[BETWEEN(false, $6, 100:DECIMAL(12, 2), 200:DECIMAL(12, 2))], EXPR$1=[BETWEEN(false, $6, 150:DECIMAL(12, 2), 300:DECIMAL(12, 2))], EXPR$2=[BETWEEN(false, $6, 50:DECIMAL(12, 2), 250:DECIMAL(12, 2))], EXPR$3=[BETWEEN(false, $5, 100:DECIMAL(3, 0), 150:DECIMAL(3, 0))], EXPR$4=[BETWEEN(false, $5, 50:DECIMAL(3, 0), 100:DECIMAL(3, 0))], EXPR$5=[BETWEEN(false, $5, 150:DECIMAL(3, 0), 200:DECIMAL(3, 0))]) + JdbcFilter(condition=[AND(IS NOT NULL($5), IS NOT NULL($6), IS NOT NULL($1), IS NOT NULL($3), IS NOT NULL($2), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_web_page_sk=[$12], ws_order_number=[$17], ws_quantity=[$18], ws_sales_price=[$21], ws_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(wp_web_page_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(wp_web_page_sk=[$0]) + JdbcHiveTableScan(table=[[default, web_page]], table:alias=[web_page]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1998), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query86.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query86.q.out new file mode 100644 index 000000000000..3b5349430447 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query86.q.out @@ -0,0 +1,24 @@ +CBO PLAN: +HiveProject(total_sum=[$0], i_category=[$1], i_class=[$2], lochierarchy=[$3], rank_within_parent=[$4]) + HiveSortLimit(sort0=[$3], sort1=[$5], sort2=[$4], dir0=[DESC], dir1=[ASC], dir2=[ASC], fetch=[100]) + HiveProject(total_sum=[$2], i_category=[$0], i_class=[$1], lochierarchy=[+(grouping($3, 1:BIGINT), grouping($3, 0:BIGINT))], rank_within_parent=[rank() OVER (PARTITION BY +(grouping($3, 1:BIGINT), grouping($3, 0:BIGINT)), CASE(=(grouping($3, 0:BIGINT), CAST(0):BIGINT), $0, null:VARCHAR(2147483647) CHARACTER SET "UTF-16LE") ORDER BY $2 DESC NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)], (tok_function when (= (tok_table_or_col lochierarchy) 0) (tok_table_or_col i_category))=[CASE(=(+(grouping($3, 1:BIGINT), grouping($3, 0:BIGINT)), 0), $0, null:VARCHAR(2147483647) CHARACTER SET "UTF-16LE")]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2], GROUPING__ID=[$3]) + HiveAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], agg#0=[sum($2)], GROUPING__ID=[GROUPING__ID()]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject($f0=[$6], $f1=[$5], $f2=[$2]) + JdbcJoin(condition=[=($4, $1)], joinType=[inner]) + JdbcJoin(condition=[=($3, $0)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_net_paid=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_net_paid=[$29]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[d1]) + JdbcProject(i_item_sk=[$0], i_class=[$1], i_category=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_class=[$10], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query87.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query87.q.out new file mode 100644 index 000000000000..49fecff29cd6 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query87.q.out @@ -0,0 +1,69 @@ +CBO PLAN: +HiveProject(_c0=[$0]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + JdbcFilter(condition=[AND(>($3, 0), =(*($3, 2), $4))]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[sum($3)], agg#1=[sum($4)]) + JdbcProject($f0=[$0], $f1=[$1], $f2=[$2], $f4=[$4], $f5=[*($3, $4)]) + JdbcUnion(all=[true]) + JdbcProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[2:BIGINT], $f4=[$3]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[count()]) + JdbcProject($f0=[$0], $f1=[$1], $f2=[$2], $f3=[$3], $f4=[$4]) + JdbcFilter(condition=[AND(>($3, 0), =(*($3, 2), $4))]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[sum($3)], agg#1=[sum($4)]) + JdbcProject($f0=[$0], $f1=[$1], $f2=[$2], $f4=[$4], $f5=[*($3, $4)]) + JdbcUnion(all=[true]) + JdbcProject($f0=[$2], $f1=[$1], $f2=[$0], $f3=[2:BIGINT], $f4=[$3]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[count()]) + JdbcAggregate(group=[{3, 5, 6}]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ss_sold_date_sk=[$0], ss_customer_sk=[$3]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$1], c_last_name=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject($f0=[$2], $f1=[$1], $f2=[$0], $f3=[1:BIGINT], $f4=[$3]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[count()]) + JdbcAggregate(group=[{3, 5, 6}]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$1], c_last_name=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject($f0=[$2], $f1=[$1], $f2=[$0], $f3=[1:BIGINT], $f4=[$3]) + JdbcAggregate(group=[{0, 1, 2}], agg#0=[count()]) + JdbcAggregate(group=[{3, 5, 6}]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $2)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$1]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(ws_sold_date_sk=[$0], ws_bill_customer_sk=[$4]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, $2, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$1], c_last_name=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(c_customer_sk=[$0], c_first_name=[$8], c_last_name=[$9]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query88.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query88.q.out new file mode 100644 index 000000000000..b653347922ed --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query88.q.out @@ -0,0 +1,193 @@ +Warning: Shuffle Join MERGEJOIN[39][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product +Warning: Shuffle Join MERGEJOIN[40][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Reducer 3' is a cross product +Warning: Shuffle Join MERGEJOIN[41][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3]] in Stage 'Reducer 4' is a cross product +Warning: Shuffle Join MERGEJOIN[42][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4]] in Stage 'Reducer 5' is a cross product +Warning: Shuffle Join MERGEJOIN[43][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5]] in Stage 'Reducer 6' is a cross product +Warning: Shuffle Join MERGEJOIN[44][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6]] in Stage 'Reducer 7' is a cross product +Warning: Shuffle Join MERGEJOIN[45][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7]] in Stage 'Reducer 8' is a cross product +CBO PLAN: +HiveProject(s1.h8_30_to_9=[$0], s2.h9_to_9_30=[$7], s3.h9_30_to_10=[$6], s4.h10_to_10_30=[$5], s5.h10_30_to_11=[$4], s6.h11_to_11_30=[$3], s7.h11_30_to_12=[$2], s8.h12_to_12_30=[$1]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_time_sk=[$0], ss_hdemo_sk=[$1], ss_store_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], ss_store_sk=[$7]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(<=($2, 5), OR(AND(=($1, 3), IS NOT NULL($2)), AND(=($1, 0), <=($2, 2)), AND(=($1, 1), <=($2, 3))), IN($1, 0, 1, 3), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(>=($2, 30), =($1, 8), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_hour=[$3], t_minute=[$4]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'ese'), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_time_sk=[$0], ss_hdemo_sk=[$1], ss_store_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], ss_store_sk=[$7]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(<=($2, 5), OR(AND(=($1, 3), IS NOT NULL($2)), AND(=($1, 0), <=($2, 2)), AND(=($1, 1), <=($2, 3))), IN($1, 0, 1, 3), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(<($2, 30), =($1, 12), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_hour=[$3], t_minute=[$4]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'ese'), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_time_sk=[$0], ss_hdemo_sk=[$1], ss_store_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], ss_store_sk=[$7]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(<=($2, 5), OR(AND(=($1, 3), IS NOT NULL($2)), AND(=($1, 0), <=($2, 2)), AND(=($1, 1), <=($2, 3))), IN($1, 0, 1, 3), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(>=($2, 30), =($1, 11), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_hour=[$3], t_minute=[$4]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'ese'), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_time_sk=[$0], ss_hdemo_sk=[$1], ss_store_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], ss_store_sk=[$7]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(<=($2, 5), OR(AND(=($1, 3), IS NOT NULL($2)), AND(=($1, 0), <=($2, 2)), AND(=($1, 1), <=($2, 3))), IN($1, 0, 1, 3), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(<($2, 30), =($1, 11), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_hour=[$3], t_minute=[$4]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'ese'), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_time_sk=[$0], ss_hdemo_sk=[$1], ss_store_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], ss_store_sk=[$7]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(<=($2, 5), OR(AND(=($1, 3), IS NOT NULL($2)), AND(=($1, 0), <=($2, 2)), AND(=($1, 1), <=($2, 3))), IN($1, 0, 1, 3), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(>=($2, 30), =($1, 10), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_hour=[$3], t_minute=[$4]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'ese'), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_time_sk=[$0], ss_hdemo_sk=[$1], ss_store_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], ss_store_sk=[$7]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(<=($2, 5), OR(AND(=($1, 3), IS NOT NULL($2)), AND(=($1, 0), <=($2, 2)), AND(=($1, 1), <=($2, 3))), IN($1, 0, 1, 3), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(<($2, 30), =($1, 10), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_hour=[$3], t_minute=[$4]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'ese'), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_time_sk=[$0], ss_hdemo_sk=[$1], ss_store_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], ss_store_sk=[$7]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(<=($2, 5), OR(AND(=($1, 3), IS NOT NULL($2)), AND(=($1, 0), <=($2, 2)), AND(=($1, 1), <=($2, 3))), IN($1, 0, 1, 3), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(>=($2, 30), =($1, 9), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_hour=[$3], t_minute=[$4]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'ese'), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_time_sk=[$0], ss_hdemo_sk=[$1], ss_store_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], ss_store_sk=[$7]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(<=($2, 5), OR(AND(=($1, 3), IS NOT NULL($2)), AND(=($1, 0), <=($2, 2)), AND(=($1, 1), <=($2, 3))), IN($1, 0, 1, 3), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3], hd_vehicle_count=[$4]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(<($2, 30), =($1, 9), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_hour=[$3], t_minute=[$4]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'ese'), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query89.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query89.q.out new file mode 100644 index 000000000000..533c0925b393 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query89.q.out @@ -0,0 +1,29 @@ +CBO PLAN: +HiveProject(tmp1.i_category=[$0], tmp1.i_class=[$1], tmp1.i_brand=[$2], tmp1.s_store_name=[$3], tmp1.s_company_name=[$4], tmp1.d_moy=[$5], tmp1.sum_sales=[$6], tmp1.avg_monthly_sales=[$7]) + HiveSortLimit(sort0=[$8], sort1=[$3], dir0=[ASC], dir1=[ASC], fetch=[100]) + HiveProject(i_category=[$0], i_class=[$1], i_brand=[$2], s_store_name=[$3], s_company_name=[$4], d_moy=[$5], sum_sales=[$6], avg_monthly_sales=[$7], (- (tok_table_or_col sum_sales) (tok_table_or_col avg_monthly_sales))1=[-($6, $7)]) + HiveFilter(condition=[CASE(<>($7, 0:DECIMAL(1, 0)), >(/(ABS(-($6, $7)), $7), 0.1:DECIMAL(1, 1)), false)]) + HiveProject((tok_table_or_col i_category)=[$5], (tok_table_or_col i_class)=[$4], (tok_table_or_col i_brand)=[$3], (tok_table_or_col s_store_name)=[$1], (tok_table_or_col s_company_name)=[$2], (tok_table_or_col d_moy)=[$0], (tok_function sum (tok_table_or_col ss_sales_price))=[$6], avg_window_0=[avg($6) OVER (PARTITION BY $5, $3, $1, $2 ORDER BY $5 NULLS FIRST, $3 NULLS FIRST, $1 NULLS FIRST, $2 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)]) + HiveProject(d_moy=[$0], s_store_name=[$1], s_company_name=[$2], i_brand=[$3], i_class=[$4], i_category=[$5], $f6=[$6]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{5, 7, 8, 10, 11, 12}], agg#0=[sum($3)]) + JdbcJoin(condition=[=($1, $9)], joinType=[inner]) + JdbcJoin(condition=[=($2, $6)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_store_sk=[$2], ss_sales_price=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_store_sk=[$7], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0], d_moy=[$2]) + JdbcFilter(condition=[AND(=($1, 2000), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(s_store_sk=[$0], s_store_name=[$1], s_company_name=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5], s_company_name=[$17]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + JdbcProject(i_item_sk=[$0], i_brand=[$1], i_class=[$2], i_category=[$3]) + JdbcFilter(condition=[AND(OR(AND(IN($3, _UTF-16LE'Books':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Electronics':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Home':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'musical':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'parenting':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'wallpaper':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")), AND(IN($3, _UTF-16LE'Jewelry':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Men':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Shoes':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'birdal':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'pants':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'womens':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"))), IN($2, _UTF-16LE'birdal':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'musical':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'pants':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'parenting':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'wallpaper':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'womens':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($3, _UTF-16LE'Books':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Electronics':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Home':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Jewelry':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Men':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Shoes':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_brand=[$8], i_class=[$10], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query9.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query9.q.out new file mode 100644 index 000000000000..8dda47913311 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query9.q.out @@ -0,0 +1,143 @@ +Warning: Shuffle Join MERGEJOIN[79][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product +Warning: Shuffle Join MERGEJOIN[80][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Reducer 3' is a cross product +Warning: Shuffle Join MERGEJOIN[81][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3]] in Stage 'Reducer 4' is a cross product +Warning: Shuffle Join MERGEJOIN[82][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4]] in Stage 'Reducer 5' is a cross product +Warning: Shuffle Join MERGEJOIN[83][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5]] in Stage 'Reducer 6' is a cross product +Warning: Shuffle Join MERGEJOIN[84][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6]] in Stage 'Reducer 7' is a cross product +Warning: Shuffle Join MERGEJOIN[85][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7]] in Stage 'Reducer 8' is a cross product +Warning: Shuffle Join MERGEJOIN[86][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8]] in Stage 'Reducer 9' is a cross product +Warning: Shuffle Join MERGEJOIN[87][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9]] in Stage 'Reducer 10' is a cross product +Warning: Shuffle Join MERGEJOIN[88][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9, $hdt$_10]] in Stage 'Reducer 11' is a cross product +Warning: Shuffle Join MERGEJOIN[89][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9, $hdt$_10, $hdt$_11]] in Stage 'Reducer 12' is a cross product +Warning: Shuffle Join MERGEJOIN[90][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9, $hdt$_10, $hdt$_11, $hdt$_12]] in Stage 'Reducer 13' is a cross product +Warning: Shuffle Join MERGEJOIN[91][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9, $hdt$_10, $hdt$_11, $hdt$_12, $hdt$_13]] in Stage 'Reducer 14' is a cross product +Warning: Shuffle Join MERGEJOIN[92][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9, $hdt$_10, $hdt$_11, $hdt$_12, $hdt$_13, $hdt$_14]] in Stage 'Reducer 15' is a cross product +Warning: Shuffle Join MERGEJOIN[93][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9, $hdt$_10, $hdt$_11, $hdt$_12, $hdt$_13, $hdt$_14, $hdt$_15]] in Stage 'Reducer 16' is a cross product +CBO PLAN: +HiveProject(bucket1=[CASE($1, $2, $3)], bucket2=[CASE($4, $5, $6)], bucket3=[CASE($7, $8, $9)], bucket4=[CASE($10, $11, $12)], bucket5=[CASE($13, $14, $15)]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not available]) + HiveProject(r_reason_sk=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[=($0, 1)]) + JdbcProject(r_reason_sk=[$0]) + JdbcHiveTableScan(table=[[default, reason]], table:alias=[reason]) + HiveProject(EXPR$0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(EXPR$0=[>($0, 409437)]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcFilter(condition=[BETWEEN(false, $0, 1, 20)]) + JdbcProject(ss_quantity=[$10]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(_o__c0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(_o__c0=[CAST(/($0, $1)):DECIMAL(11, 6)]) + JdbcAggregate(group=[{}], agg#0=[sum($1)], agg#1=[count($1)]) + JdbcFilter(condition=[BETWEEN(false, $0, 1, 20)]) + JdbcProject(ss_quantity=[$10], ss_ext_list_price=[$17]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(_o__c0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(_o__c0=[CAST(/($0, $1)):DECIMAL(11, 6)]) + JdbcAggregate(group=[{}], agg#0=[sum($1)], agg#1=[count($1)]) + JdbcFilter(condition=[BETWEEN(false, $0, 1, 20)]) + JdbcProject(ss_quantity=[$10], ss_net_paid_inc_tax=[$21]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(EXPR$1=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(EXPR$1=[>($0, 4595804)]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcFilter(condition=[BETWEEN(false, $0, 21, 40)]) + JdbcProject(ss_quantity=[$10]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(_o__c0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(_o__c0=[CAST(/($0, $1)):DECIMAL(11, 6)]) + JdbcAggregate(group=[{}], agg#0=[sum($1)], agg#1=[count($1)]) + JdbcFilter(condition=[BETWEEN(false, $0, 21, 40)]) + JdbcProject(ss_quantity=[$10], ss_ext_list_price=[$17]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(_o__c0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(_o__c0=[CAST(/($0, $1)):DECIMAL(11, 6)]) + JdbcAggregate(group=[{}], agg#0=[sum($1)], agg#1=[count($1)]) + JdbcFilter(condition=[BETWEEN(false, $0, 21, 40)]) + JdbcProject(ss_quantity=[$10], ss_net_paid_inc_tax=[$21]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(EXPR$2=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(EXPR$2=[>($0, 7887297)]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcFilter(condition=[BETWEEN(false, $0, 41, 60)]) + JdbcProject(ss_quantity=[$10]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(_o__c0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(_o__c0=[CAST(/($0, $1)):DECIMAL(11, 6)]) + JdbcAggregate(group=[{}], agg#0=[sum($1)], agg#1=[count($1)]) + JdbcFilter(condition=[BETWEEN(false, $0, 41, 60)]) + JdbcProject(ss_quantity=[$10], ss_ext_list_price=[$17]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(_o__c0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(_o__c0=[CAST(/($0, $1)):DECIMAL(11, 6)]) + JdbcAggregate(group=[{}], agg#0=[sum($1)], agg#1=[count($1)]) + JdbcFilter(condition=[BETWEEN(false, $0, 41, 60)]) + JdbcProject(ss_quantity=[$10], ss_net_paid_inc_tax=[$21]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(EXPR$3=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(EXPR$3=[>($0, 10872978)]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcFilter(condition=[BETWEEN(false, $0, 61, 80)]) + JdbcProject(ss_quantity=[$10]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(_o__c0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(_o__c0=[CAST(/($0, $1)):DECIMAL(11, 6)]) + JdbcAggregate(group=[{}], agg#0=[sum($1)], agg#1=[count($1)]) + JdbcFilter(condition=[BETWEEN(false, $0, 61, 80)]) + JdbcProject(ss_quantity=[$10], ss_ext_list_price=[$17]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(_o__c0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(_o__c0=[CAST(/($0, $1)):DECIMAL(11, 6)]) + JdbcAggregate(group=[{}], agg#0=[sum($1)], agg#1=[count($1)]) + JdbcFilter(condition=[BETWEEN(false, $0, 61, 80)]) + JdbcProject(ss_quantity=[$10], ss_net_paid_inc_tax=[$21]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(EXPR$4=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(EXPR$4=[>($0, 43571537)]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcFilter(condition=[BETWEEN(false, $0, 81, 100)]) + JdbcProject(ss_quantity=[$10]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(_o__c0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(_o__c0=[CAST(/($0, $1)):DECIMAL(11, 6)]) + JdbcAggregate(group=[{}], agg#0=[sum($1)], agg#1=[count($1)]) + JdbcFilter(condition=[BETWEEN(false, $0, 81, 100)]) + JdbcProject(ss_quantity=[$10], ss_ext_list_price=[$17]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + HiveProject(_o__c0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(_o__c0=[CAST(/($0, $1)):DECIMAL(11, 6)]) + JdbcAggregate(group=[{}], agg#0=[sum($1)], agg#1=[count($1)]) + JdbcFilter(condition=[BETWEEN(false, $0, 81, 100)]) + JdbcProject(ss_quantity=[$10], ss_net_paid_inc_tax=[$21]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query90.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query90.q.out new file mode 100644 index 000000000000..67fa799b3aa3 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query90.q.out @@ -0,0 +1,49 @@ +Warning: Shuffle Join MERGEJOIN[9][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product +CBO PLAN: +HiveProject(am_pm_ratio=[/(CAST($0):DECIMAL(15, 4), CAST($1):DECIMAL(15, 4))]) + HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ws_sold_time_sk=[$0], ws_ship_hdemo_sk=[$1], ws_web_page_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ws_sold_time_sk=[$1], ws_ship_hdemo_sk=[$10], ws_web_page_sk=[$12]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 8), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 6, 7), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_hour=[$3]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(wp_web_page_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 5000, 5200), IS NOT NULL($0))]) + JdbcProject(wp_web_page_sk=[$0], wp_char_count=[$10]) + JdbcHiveTableScan(table=[[default, web_page]], table:alias=[web_page]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ws_sold_time_sk=[$0], ws_ship_hdemo_sk=[$1], ws_web_page_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ws_sold_time_sk=[$1], ws_ship_hdemo_sk=[$10], ws_web_page_sk=[$12]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 8), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 14, 15), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_hour=[$3]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(wp_web_page_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 5000, 5200), IS NOT NULL($0))]) + JdbcProject(wp_web_page_sk=[$0], wp_char_count=[$10]) + JdbcHiveTableScan(table=[[default, web_page]], table:alias=[web_page]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query91.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query91.q.out new file mode 100644 index 000000000000..2991c19bb45c --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query91.q.out @@ -0,0 +1,44 @@ +CBO PLAN: +HiveProject(call_center=[$0], call_center_name=[$1], manager=[$2], returns_loss=[$3]) + HiveProject(call_center=[$0], call_center_name=[$1], manager=[$2], returns_loss=[$3]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(call_center=[$0], call_center_name=[$1], manager=[$2], returns_loss=[$3]) + JdbcSort(sort0=[$4], dir0=[DESC]) + JdbcProject(call_center=[$2], call_center_name=[$3], manager=[$4], returns_loss=[$5], (tok_function sum (tok_table_or_col cr_net_loss))=[$5]) + JdbcAggregate(group=[{7, 8, 15, 16, 17}], agg#0=[sum($12)]) + JdbcJoin(condition=[=($10, $0)], joinType=[inner]) + JdbcJoin(condition=[=($6, $1)], joinType=[inner]) + JdbcJoin(condition=[=($5, $2)], joinType=[inner]) + JdbcJoin(condition=[=($4, $3)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$1], c_current_hdemo_sk=[$2], c_current_addr_sk=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($3), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(c_customer_sk=[$0], c_current_cdemo_sk=[$2], c_current_hdemo_sk=[$3], c_current_addr_sk=[$4]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(ca_address_sk=[$0]) + JdbcFilter(condition=[AND(=($1, -7:DECIMAL(1, 0)), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_gmt_offset=[$11]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(LIKE($1, _UTF-16LE'0-500%':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_buy_potential=[$2]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$1], cd_education_status=[$2]) + JdbcFilter(condition=[AND(OR(AND(=($1, _UTF-16LE'M'), =($2, _UTF-16LE'Unknown')), AND(=($1, _UTF-16LE'W'), =($2, _UTF-16LE'Advanced Degree'))), IN($1, _UTF-16LE'M':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'W':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IN($2, _UTF-16LE'Advanced Degree':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Unknown':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(cd_demo_sk=[$0], cd_marital_status=[$2], cd_education_status=[$3]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[customer_demographics]) + JdbcProject(cr_returned_date_sk=[$0], cr_returning_customer_sk=[$1], cr_call_center_sk=[$2], cr_net_loss=[$3], d_date_sk=[$4], cc_call_center_sk=[$5], cc_call_center_id=[$6], cc_name=[$7], cc_manager=[$8]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcProject(cr_returned_date_sk=[$0], cr_returning_customer_sk=[$1], cr_call_center_sk=[$2], cr_net_loss=[$3]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(cr_returned_date_sk=[$0], cr_returning_customer_sk=[$7], cr_call_center_sk=[$11], cr_net_loss=[$26]) + JdbcHiveTableScan(table=[[default, catalog_returns]], table:alias=[catalog_returns]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 1999), =($2, 11), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6], d_moy=[$8]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(cc_call_center_sk=[$0], cc_call_center_id=[$1], cc_name=[$2], cc_manager=[$3]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cc_call_center_sk=[$0], cc_call_center_id=[$1], cc_name=[$6], cc_manager=[$11]) + JdbcHiveTableScan(table=[[default, call_center]], table:alias=[call_center]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query92.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query92.q.out new file mode 100644 index 000000000000..2f63ff0c5e1d --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query92.q.out @@ -0,0 +1,33 @@ +CBO PLAN: +HiveProject(excess discount amount=[$0]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[sum($2)]) + JdbcJoin(condition=[AND(=($6, $3), >($2, $5))], joinType=[inner]) + JdbcJoin(condition=[=($4, $0)], joinType=[inner]) + JdbcJoin(condition=[=($3, $1)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_ext_discount_amt=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_ext_discount_amt=[$22]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(i_item_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 269), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_manufact_id=[$13]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-03-18 00:00:00:TIMESTAMP(9), 1998-06-16 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(_o__c0=[*(1.3:DECIMAL(2, 1), CAST(/($1, $2)):DECIMAL(11, 6))], ws_item_sk=[$0]) + JdbcFilter(condition=[IS NOT NULL(CAST(/($1, $2)):DECIMAL(11, 6))]) + JdbcAggregate(group=[{1}], agg#0=[sum($2)], agg#1=[count($2)]) + JdbcJoin(condition=[=($3, $0)], joinType=[inner]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$1], ws_ext_discount_amt=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], ws_ext_discount_amt=[$22]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[web_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1998-03-18 00:00:00:TIMESTAMP(9), 1998-06-16 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query93.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query93.q.out new file mode 100644 index 000000000000..4b0909c98120 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query93.q.out @@ -0,0 +1,22 @@ +CBO PLAN: +HiveProject(ss_customer_sk=[$0], sumsales=[$1]) + HiveProject($f0=[$0], $f1=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcSort(sort0=[$1], sort1=[$0], dir0=[ASC], dir1=[ASC], fetch=[100]) + JdbcAggregate(group=[{0}], agg#0=[sum($1)]) + JdbcProject($f0=[$7], $f1=[CASE($4, *(CAST(-($9, $3)):DECIMAL(10, 0), $10), $11)]) + JdbcJoin(condition=[AND(=($0, $6), =($2, $8))], joinType=[inner]) + JdbcJoin(condition=[=($1, $5)], joinType=[inner]) + JdbcProject(sr_item_sk=[$0], sr_reason_sk=[$1], sr_ticket_number=[$2], sr_return_quantity=[$3], EXPR$0=[IS NOT NULL($3)]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(sr_item_sk=[$2], sr_reason_sk=[$8], sr_ticket_number=[$9], sr_return_quantity=[$10]) + JdbcHiveTableScan(table=[[default, store_returns]], table:alias=[store_returns]) + JdbcProject(r_reason_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'Did not like the warranty'), IS NOT NULL($0))]) + JdbcProject(r_reason_sk=[$0], r_reason_desc=[$2]) + JdbcHiveTableScan(table=[[default, reason]], table:alias=[reason]) + JdbcProject(ss_item_sk=[$0], ss_customer_sk=[$1], ss_ticket_number=[$2], ss_quantity=[$3], ss_sales_price=[$4], EXPR$0=[*(CAST($3):DECIMAL(10, 0), $4)]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_item_sk=[$2], ss_customer_sk=[$3], ss_ticket_number=[$9], ss_quantity=[$10], ss_sales_price=[$13]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query94.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query94.q.out new file mode 100644 index 000000000000..e2657e1433ab --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query94.q.out @@ -0,0 +1,38 @@ +CBO PLAN: +HiveProject(order count=[$0], total shipping cost=[$1], total net profit=[$2]) + HiveAggregate(group=[{}], agg#0=[count(DISTINCT $4)], agg#1=[sum($5)], agg#2=[sum($6)]) + HiveAntiJoin(condition=[=($4, $14)], joinType=[anti]) + HiveSemiJoin(condition=[AND(=($4, $14), <>($3, $13))], joinType=[semi]) + HiveProject(ws_ship_date_sk=[$0], ws_ship_addr_sk=[$1], ws_web_site_sk=[$2], ws_warehouse_sk=[$3], ws_order_number=[$4], ws_ext_ship_cost=[$5], ws_net_profit=[$6], d_date_sk=[$7], d_date=[$8], ca_address_sk=[$9], ca_state=[$10], web_site_sk=[$11], web_company_name=[$12]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($2, $11)], joinType=[inner]) + JdbcJoin(condition=[=($1, $9)], joinType=[inner]) + JdbcJoin(condition=[=($0, $7)], joinType=[inner]) + JdbcProject(ws_ship_date_sk=[$0], ws_ship_addr_sk=[$1], ws_web_site_sk=[$2], ws_warehouse_sk=[$3], ws_order_number=[$4], ws_ext_ship_cost=[$5], ws_net_profit=[$6]) + JdbcFilter(condition=[AND(IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2), IS NOT NULL($4))]) + JdbcProject(ws_ship_date_sk=[$2], ws_ship_addr_sk=[$11], ws_web_site_sk=[$13], ws_warehouse_sk=[$15], ws_order_number=[$17], ws_ext_ship_cost=[$28], ws_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[ws1]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1999-05-01 00:00:00:TIMESTAMP(9), 1999-06-30 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_state=[$1]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'TX'), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(web_site_sk=[$0], web_company_name=[$1]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'pri'), IS NOT NULL($0))]) + JdbcProject(web_site_sk=[$0], web_company_name=[$14]) + JdbcHiveTableScan(table=[[default, web_site]], table:alias=[web_site]) + HiveProject(ws_warehouse_sk=[$0], ws_order_number=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ws_warehouse_sk=[$15], ws_order_number=[$17]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[ws2]) + HiveProject(literalTrue=[$0], wr_order_number=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(literalTrue=[true], wr_order_number=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(wr_order_number=[$13]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[wr1]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query95.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query95.q.out new file mode 100644 index 000000000000..64bafb669263 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query95.q.out @@ -0,0 +1,56 @@ +CBO PLAN: +HiveProject(order count=[$0], total shipping cost=[$1], total net profit=[$2]) + HiveAggregate(group=[{}], agg#0=[count(DISTINCT $3)], agg#1=[sum($4)], agg#2=[sum($5)]) + HiveSemiJoin(condition=[=($3, $12)], joinType=[semi]) + HiveSemiJoin(condition=[=($3, $12)], joinType=[semi]) + HiveProject(ws_ship_date_sk=[$0], ws_ship_addr_sk=[$1], ws_web_site_sk=[$2], ws_order_number=[$3], ws_ext_ship_cost=[$4], ws_net_profit=[$5], d_date_sk=[$6], d_date=[$7], ca_address_sk=[$8], ca_state=[$9], web_site_sk=[$10], web_company_name=[$11]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($2, $10)], joinType=[inner]) + JdbcJoin(condition=[=($1, $8)], joinType=[inner]) + JdbcJoin(condition=[=($0, $6)], joinType=[inner]) + JdbcProject(ws_ship_date_sk=[$0], ws_ship_addr_sk=[$1], ws_web_site_sk=[$2], ws_order_number=[$3], ws_ext_ship_cost=[$4], ws_net_profit=[$5]) + JdbcFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($0), IS NOT NULL($1), IS NOT NULL($2))]) + JdbcProject(ws_ship_date_sk=[$2], ws_ship_addr_sk=[$11], ws_web_site_sk=[$13], ws_order_number=[$17], ws_ext_ship_cost=[$28], ws_net_profit=[$33]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[ws1]) + JdbcProject(d_date_sk=[$0], d_date=[$1]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 1999-05-01 00:00:00:TIMESTAMP(9), 1999-06-30 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(ca_address_sk=[$0], ca_state=[$1]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'TX'), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + JdbcProject(web_site_sk=[$0], web_company_name=[$1]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'pri'), IS NOT NULL($0))]) + JdbcProject(web_site_sk=[$0], web_company_name=[$14]) + JdbcHiveTableScan(table=[[default, web_site]], table:alias=[web_site]) + HiveProject(ws_order_number=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(ws_order_number=[$1]) + JdbcJoin(condition=[AND(=($1, $3), <>($0, $2))], joinType=[inner]) + JdbcProject(ws_warehouse_sk=[$0], ws_order_number=[$1]) + JdbcFilter(condition=[IS NOT NULL($1)]) + JdbcProject(ws_warehouse_sk=[$15], ws_order_number=[$17]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[ws1]) + JdbcProject(ws_warehouse_sk=[$0], ws_order_number=[$1]) + JdbcFilter(condition=[IS NOT NULL($1)]) + JdbcProject(ws_warehouse_sk=[$15], ws_order_number=[$17]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[ws2]) + HiveProject(wr_order_number=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcProject(wr_order_number=[$2]) + JdbcJoin(condition=[AND(=($1, $4), <>($0, $3))], joinType=[inner]) + JdbcJoin(condition=[=($2, $1)], joinType=[inner]) + JdbcProject(ws_warehouse_sk=[$0], ws_order_number=[$1]) + JdbcFilter(condition=[IS NOT NULL($1)]) + JdbcProject(ws_warehouse_sk=[$15], ws_order_number=[$17]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[ws1]) + JdbcProject(wr_order_number=[$0]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(wr_order_number=[$13]) + JdbcHiveTableScan(table=[[default, web_returns]], table:alias=[web_returns]) + JdbcProject(ws_warehouse_sk=[$0], ws_order_number=[$1]) + JdbcFilter(condition=[IS NOT NULL($1)]) + JdbcProject(ws_warehouse_sk=[$15], ws_order_number=[$17]) + JdbcHiveTableScan(table=[[default, web_sales]], table:alias=[ws2]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query96.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query96.q.out new file mode 100644 index 000000000000..19612b281358 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query96.q.out @@ -0,0 +1,25 @@ +CBO PLAN: +HiveProject(_c0=[$0]) + HiveProject($f0=[$0]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[count()]) + JdbcJoin(condition=[=($2, $5)], joinType=[inner]) + JdbcJoin(condition=[=($0, $4)], joinType=[inner]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(ss_sold_time_sk=[$0], ss_hdemo_sk=[$1], ss_store_sk=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($2))]) + JdbcProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], ss_store_sk=[$7]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(hd_demo_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 5), IS NOT NULL($0))]) + JdbcProject(hd_demo_sk=[$0], hd_dep_count=[$3]) + JdbcHiveTableScan(table=[[default, household_demographics]], table:alias=[household_demographics]) + JdbcProject(t_time_sk=[$0]) + JdbcFilter(condition=[AND(>=($2, 30), =($1, 8), IS NOT NULL($0))]) + JdbcProject(t_time_sk=[$0], t_hour=[$3], t_minute=[$4]) + JdbcHiveTableScan(table=[[default, time_dim]], table:alias=[time_dim]) + JdbcProject(s_store_sk=[$0]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'ese'), IS NOT NULL($0))]) + JdbcProject(s_store_sk=[$0], s_store_name=[$5]) + JdbcHiveTableScan(table=[[default, store]], table:alias=[store]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query97.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query97.q.out new file mode 100644 index 000000000000..50fbb2db5322 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query97.q.out @@ -0,0 +1,29 @@ +CBO PLAN: +HiveProject(store_only=[$0], catalog_only=[$1], store_and_catalog=[$2]) + HiveProject($f0=[$0], $f1=[$1], $f2=[$2]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{}], agg#0=[sum($0)], agg#1=[sum($1)], agg#2=[sum($2)]) + JdbcProject($f0=[CAST(CASE(AND(IS NULL($2), IS NOT NULL($0)), 1, 0)):INTEGER], $f1=[CAST(CASE(AND(IS NULL($0), IS NOT NULL($2)), 1, 0)):INTEGER], $f2=[CAST(CASE(AND(IS NOT NULL($0), IS NOT NULL($2)), 1, 0)):INTEGER]) + JdbcJoin(condition=[AND(=($0, $2), =($1, $3))], joinType=[full]) + JdbcProject(ss_customer_sk=[$1], ss_item_sk=[$0]) + JdbcAggregate(group=[{1, 2}]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_customer_sk=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_customer_sk=[$3]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcAggregate(group=[{1, 2}]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_item_sk=[$2]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], cs_item_sk=[$15]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query98.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query98.q.out new file mode 100644 index 000000000000..2645d0149f8d --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query98.q.out @@ -0,0 +1,22 @@ +CBO PLAN: +HiveProject(i_item_desc=[$0], i_category=[$1], i_class=[$2], i_current_price=[$3], itemrevenue=[$4], revenueratio=[$5]) + HiveSortLimit(sort0=[$1], sort1=[$2], sort2=[$6], sort3=[$0], sort4=[$5], dir0=[ASC], dir1=[ASC], dir2=[ASC], dir3=[ASC], dir4=[ASC]) + HiveProject(i_item_desc=[$1], i_category=[$4], i_class=[$3], i_current_price=[$2], itemrevenue=[$5], revenueratio=[/(*($5, 100:DECIMAL(10, 0)), sum($5) OVER (PARTITION BY $3 ORDER BY $3 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING))], (tok_table_or_col i_item_id)=[$0]) + HiveProject(i_item_id=[$0], i_item_desc=[$1], i_current_price=[$2], i_class=[$3], i_category=[$4], $f5=[$5]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcAggregate(group=[{5, 6, 7, 8, 9}], agg#0=[sum($2)]) + JdbcJoin(condition=[=($1, $4)], joinType=[inner]) + JdbcJoin(condition=[=($0, $3)], joinType=[inner]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$1], ss_ext_sales_price=[$2]) + JdbcFilter(condition=[AND(IS NOT NULL($1), IS NOT NULL($0))]) + JdbcProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], ss_ext_sales_price=[$15]) + JdbcHiveTableScan(table=[[default, store_sales]], table:alias=[store_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, CAST($1):TIMESTAMP(9), 2001-01-12 00:00:00:TIMESTAMP(9), 2001-02-11 00:00:00:TIMESTAMP(9)), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_date=[$2]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$2], i_current_price=[$3], i_class=[$4], i_category=[$5]) + JdbcFilter(condition=[AND(IN($5, _UTF-16LE'Books':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Jewelry':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'Sports':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1], i_item_desc=[$4], i_current_price=[$5], i_class=[$10], i_category=[$12]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query99.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query99.q.out new file mode 100644 index 000000000000..7b95e425e0ee --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query99.q.out @@ -0,0 +1,36 @@ +CBO PLAN: +HiveProject(_c0=[$0], sm_type=[$1], cc_name=[$2], 30 days=[$3], 31-60 days=[$4], 61-90 days=[$5], 91-120 days=[$6], >120 days=[$7]) + HiveSortLimit(sort0=[$8], sort1=[$1], sort2=[$2], dir0=[ASC], dir1=[ASC], dir2=[ASC], fetch=[100]) + HiveProject(_o__c0=[$0], sm_type=[$1], cc_name=[$2], 30 days=[$3], 31-60 days=[$4], 61-90 days=[$5], 91-120 days=[$6], >120 days=[$7], (tok_function substr (tok_table_or_col w_warehouse_name) 1 20)=[$0]) + HiveAggregate(group=[{11, 13, 15}], agg#0=[sum($4)], agg#1=[sum($5)], agg#2=[sum($6)], agg#3=[sum($7)], agg#4=[sum($8)]) + HiveJoin(condition=[=($1, $14)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($2, $12)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveJoin(condition=[=($3, $10)], joinType=[inner], algorithm=[none], cost=[not available]) + HiveProject(cs_ship_date_sk=[$0], cs_call_center_sk=[$1], cs_ship_mode_sk=[$2], cs_warehouse_sk=[$3], $f3=[$4], $f4=[$5], $f5=[$6], $f6=[$7], $f7=[$8], d_date_sk=[$9]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($0, $9)], joinType=[inner]) + JdbcProject(cs_ship_date_sk=[$1], cs_call_center_sk=[$2], cs_ship_mode_sk=[$3], cs_warehouse_sk=[$4], $f3=[CASE(<=(-($1, $0), 30), 1, 0)], $f4=[CASE(AND(>(-($1, $0), 30), <=(-($1, $0), 60)), 1, 0)], $f5=[CASE(AND(>(-($1, $0), 60), <=(-($1, $0), 90)), 1, 0)], $f6=[CASE(AND(>(-($1, $0), 90), <=(-($1, $0), 120)), 1, 0)], $f7=[CASE(>(-($1, $0), 120), 1, 0)]) + JdbcFilter(condition=[AND(IS NOT NULL($4), IS NOT NULL($3), IS NOT NULL($2), IS NOT NULL($1))]) + JdbcProject(cs_sold_date_sk=[$0], cs_ship_date_sk=[$2], cs_call_center_sk=[$11], cs_ship_mode_sk=[$13], cs_warehouse_sk=[$14]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(BETWEEN(false, $1, 1212, 1223), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_month_seq=[$3]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + HiveProject(w_warehouse_sk=[$0], $f0=[substr($1, 1, 20)]) + HiveProject(w_warehouse_sk=[$0], w_warehouse_name=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(w_warehouse_sk=[$0], w_warehouse_name=[$2]) + JdbcHiveTableScan(table=[[default, warehouse]], table:alias=[warehouse]) + HiveProject(sm_ship_mode_sk=[$0], sm_type=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(sm_ship_mode_sk=[$0], sm_type=[$2]) + JdbcHiveTableScan(table=[[default, ship_mode]], table:alias=[ship_mode]) + HiveProject(cc_call_center_sk=[$0], cc_name=[$1]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(cc_call_center_sk=[$0], cc_name=[$6]) + JdbcHiveTableScan(table=[[default, call_center]], table:alias=[call_center]) + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query_grouping_sets.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query_grouping_sets.q.out new file mode 100644 index 000000000000..3ab721b58b71 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/cbo_query_grouping_sets.q.out @@ -0,0 +1,156 @@ +CBO PLAN: +HiveSortLimit(sort0=[$0], sort1=[$1], sort2=[$2], dir0=[ASC], dir1=[ASC], dir2=[ASC-nulls-first], fetch=[100]) + HiveProject(ca_country=[$2], ca_state=[$1], i_item_id=[$0], agg1=[CAST(/($3, $4)):DECIMAL(16, 6)], agg6=[CAST(/($5, $6)):DECIMAL(16, 6)], agg7=[CAST(/($7, $8)):DECIMAL(16, 6)]) + HiveAggregate(group=[{9, 14, 15}], groups=[[{9, 14, 15}, {9, 15}, {9}, {}]], agg#0=[sum($4)], agg#1=[count($4)], agg#2=[sum($12)], agg#3=[count($12)], agg#4=[sum($7)], agg#5=[count($7)]) + HiveProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_bill_cdemo_sk=[$2], cs_item_sk=[$3], $f3=[$4], d_date_sk=[$5], cd_demo_sk=[$6], $f5=[$7], i_item_sk=[$8], i_item_id=[$9], c_customer_sk=[$10], c_current_addr_sk=[$11], $f4=[$12], ca_address_sk=[$13], ca_state=[$14], ca_country=[$15]) + HiveJdbcConverter(convention=[JDBC.POSTGRES]) + JdbcJoin(condition=[=($1, $10)], joinType=[inner]) + JdbcJoin(condition=[=($3, $8)], joinType=[inner]) + JdbcJoin(condition=[=($2, $6)], joinType=[inner]) + JdbcJoin(condition=[=($0, $5)], joinType=[inner]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$1], cs_bill_cdemo_sk=[$2], cs_item_sk=[$3], $f3=[CAST($4):DECIMAL(12, 2)]) + JdbcFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($1), IS NOT NULL($0), IS NOT NULL($3))]) + JdbcProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], cs_bill_cdemo_sk=[$4], cs_item_sk=[$15], cs_quantity=[$18]) + JdbcHiveTableScan(table=[[default, catalog_sales]], table:alias=[catalog_sales]) + JdbcProject(d_date_sk=[$0]) + JdbcFilter(condition=[AND(=($1, 2001), IS NOT NULL($0))]) + JdbcProject(d_date_sk=[$0], d_year=[$6]) + JdbcHiveTableScan(table=[[default, date_dim]], table:alias=[date_dim]) + JdbcProject(cd_demo_sk=[$0], $f5=[CAST($3):DECIMAL(12, 2)]) + JdbcFilter(condition=[AND(=($1, _UTF-16LE'M'), =($2, _UTF-16LE'College'), IS NOT NULL($0))]) + JdbcProject(cd_demo_sk=[$0], cd_gender=[$1], cd_education_status=[$3], cd_dep_count=[$6]) + JdbcHiveTableScan(table=[[default, customer_demographics]], table:alias=[cd1]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcFilter(condition=[IS NOT NULL($0)]) + JdbcProject(i_item_sk=[$0], i_item_id=[$1]) + JdbcHiveTableScan(table=[[default, item]], table:alias=[item]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$1], $f4=[$2], ca_address_sk=[$3], ca_state=[$4], ca_country=[$5]) + JdbcJoin(condition=[=($1, $3)], joinType=[inner]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$1], $f4=[CAST($3):DECIMAL(12, 2)]) + JdbcFilter(condition=[AND(IN($2, 5, 9), IS NOT NULL($0), IS NOT NULL($1))]) + JdbcProject(c_customer_sk=[$0], c_current_addr_sk=[$4], c_birth_month=[$12], c_birth_year=[$13]) + JdbcHiveTableScan(table=[[default, customer]], table:alias=[customer]) + JdbcProject(ca_address_sk=[$0], ca_state=[$1], ca_country=[$2]) + JdbcFilter(condition=[AND(IN($1, _UTF-16LE'AL':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'MS':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", _UTF-16LE'TN':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"), IS NOT NULL($0))]) + JdbcProject(ca_address_sk=[$0], ca_state=[$8], ca_country=[$10]) + JdbcHiveTableScan(table=[[default, customer_address]], table:alias=[customer_address]) + +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t1"."cs_sold_date_sk", "t1"."cs_bill_customer_sk", "t1"."cs_bill_cdemo_sk", "t1"."cs_item_sk", "t1"."$f3", "t4"."d_date_sk", "t7"."cd_demo_sk", "t7"."$f5", "t10"."i_item_sk", "t10"."i_item_id", "t17"."c_customer_sk", "t17"."c_current_addr_sk", "t17"."$f4", "t17"."ca_address_sk", "t17"."ca_state", "t17"."ca_country" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_bill_cdemo_sk", "cs_item_sk", CAST("cs_quantity" AS DECIMAL(12, 2)) AS "$f3" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_bill_cdemo_sk", "cs_item_sk", "cs_quantity" +FROM "catalog_sales") AS "t" +WHERE "cs_bill_cdemo_sk" IS NOT NULL AND "cs_bill_customer_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL AND "cs_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2001 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "cd_demo_sk", CAST("cd_dep_count" AS DECIMAL(12, 2)) AS "$f5" +FROM (SELECT "cd_demo_sk", "cd_gender", "cd_education_status", "cd_dep_count" +FROM "customer_demographics") AS "t5" +WHERE "cd_gender" = 'M' AND "cd_education_status" = 'College' AND "cd_demo_sk" IS NOT NULL) AS "t7" ON "t1"."cs_bill_cdemo_sk" = "t7"."cd_demo_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t8" +WHERE "i_item_sk" IS NOT NULL) AS "t10" ON "t1"."cs_item_sk" = "t10"."i_item_sk" +INNER JOIN (SELECT "t13"."c_customer_sk", "t13"."c_current_addr_sk", "t13"."$f4", "t16"."ca_address_sk", "t16"."ca_state", "t16"."ca_country" +FROM (SELECT "c_customer_sk", "c_current_addr_sk", CAST("c_birth_year" AS DECIMAL(12, 2)) AS "$f4" +FROM (SELECT "c_customer_sk", "c_current_addr_sk", "c_birth_month", "c_birth_year" +FROM "customer") AS "t11" +WHERE "c_birth_month" IN (5, 9) AND "c_customer_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL) AS "t13" +INNER JOIN (SELECT "ca_address_sk", "ca_state", "ca_country" +FROM (SELECT "ca_address_sk", "ca_state", "ca_country" +FROM "customer_address") AS "t14" +WHERE "ca_state" IN ('AL', 'MS', 'TN') AND "ca_address_sk" IS NOT NULL) AS "t16" ON "t13"."c_current_addr_sk" = "t16"."ca_address_sk") AS "t17" ON "t1"."cs_bill_customer_sk" = "t17"."c_customer_sk" + hive.sql.query.fieldNames cs_sold_date_sk,cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,$f3,d_date_sk,cd_demo_sk,$f5,i_item_sk,i_item_id,c_customer_sk,c_current_addr_sk,$f4,ca_address_sk,ca_state,ca_country + hive.sql.query.fieldTypes int,int,int,bigint,decimal(12,2),int,int,decimal(12,2),bigint,string,int,int,decimal(12,2),int,string,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 888 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f3 (type: decimal(12,2)), $f5 (type: decimal(12,2)), i_item_id (type: string), $f4 (type: decimal(12,2)), ca_state (type: string), ca_country (type: string) + outputColumnNames: _col4, _col7, _col9, _col12, _col14, _col15 + Statistics: Num rows: 1 Data size: 888 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col4), count(_col4), sum(_col12), count(_col12), sum(_col7), count(_col7) + keys: _col9 (type: string), _col14 (type: string), _col15 (type: string), 0L (type: bigint) + grouping sets: 0, 2, 3, 7 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + Statistics: Num rows: 4 Data size: 3552 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: bigint) + null sort order: zzzz + sort order: ++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: bigint) + Statistics: Num rows: 4 Data size: 3552 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: decimal(22,2)), _col5 (type: bigint), _col6 (type: decimal(22,2)), _col7 (type: bigint), _col8 (type: decimal(22,2)), _col9 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), count(VALUE._col1), sum(VALUE._col2), count(VALUE._col3), sum(VALUE._col4), count(VALUE._col5) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string), KEY._col3 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col6, _col7, _col8, _col9 + Statistics: Num rows: 2 Data size: 1776 Basic stats: COMPLETE Column stats: NONE + pruneGroupingSetId: true + Top N Key Operator + sort order: +++ + keys: _col2 (type: string), _col1 (type: string), _col0 (type: string) + null sort order: zza + Statistics: Num rows: 2 Data size: 1776 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col2 (type: string), _col1 (type: string), _col0 (type: string), CAST( (_col4 / _col5) AS decimal(16,6)) (type: decimal(16,6)), CAST( (_col6 / _col7) AS decimal(16,6)) (type: decimal(16,6)), CAST( (_col8 / _col9) AS decimal(16,6)) (type: decimal(16,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 2 Data size: 1776 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string) + null sort order: zza + sort order: +++ + Statistics: Num rows: 2 Data size: 1776 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(16,6)), _col4 (type: decimal(16,6)), _col5 (type: decimal(16,6)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), VALUE._col0 (type: decimal(16,6)), VALUE._col1 (type: decimal(16,6)), VALUE._col2 (type: decimal(16,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 2 Data size: 1776 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 2 Data size: 1776 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 2 Data size: 1776 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query1.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query1.q.out new file mode 100644 index 000000000000..d283e5f0ed99 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query1.q.out @@ -0,0 +1,55 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_returns + properties: + hive.sql.query SELECT "t25"."c_customer_id" +FROM (SELECT "t13"."c_customer_id" +FROM (SELECT "t1"."sr_customer_sk", "t1"."sr_store_sk", SUM("t1"."sr_fee") AS "$f2" +FROM (SELECT "sr_returned_date_sk", "sr_customer_sk", "sr_store_sk", "sr_fee" +FROM (SELECT "sr_returned_date_sk", "sr_customer_sk", "sr_store_sk", "sr_fee" +FROM "store_returns") AS "t" +WHERE "sr_returned_date_sk" IS NOT NULL AND "sr_store_sk" IS NOT NULL AND "sr_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."sr_returned_date_sk" = "t4"."d_date_sk" +GROUP BY "t1"."sr_customer_sk", "t1"."sr_store_sk" +HAVING SUM("t1"."sr_fee") IS NOT NULL) AS "t7" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_state" +FROM "store") AS "t8" +WHERE "s_state" = 'NM' AND "s_store_sk" IS NOT NULL) AS "t10" ON "t7"."sr_store_sk" = "t10"."s_store_sk" +INNER JOIN (SELECT "c_customer_sk", "c_customer_id" +FROM (SELECT "c_customer_sk", "c_customer_id" +FROM "customer") AS "t11" +WHERE "c_customer_sk" IS NOT NULL) AS "t13" ON "t7"."sr_customer_sk" = "t13"."c_customer_sk" +INNER JOIN (SELECT CAST(SUM("t20"."$f2") / COUNT("t20"."$f2") AS DECIMAL(19, 6)) * 1.2 AS "_o__c0", "t20"."sr_store_sk" AS "ctr_store_sk" +FROM (SELECT "t16"."sr_customer_sk", "t16"."sr_store_sk", SUM("t16"."sr_fee") AS "$f2" +FROM (SELECT "sr_returned_date_sk", "sr_customer_sk", "sr_store_sk", "sr_fee" +FROM (SELECT "sr_returned_date_sk", "sr_customer_sk", "sr_store_sk", "sr_fee" +FROM "store_returns") AS "t14" +WHERE "sr_returned_date_sk" IS NOT NULL AND "sr_store_sk" IS NOT NULL) AS "t16" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t17" +WHERE "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t19" ON "t16"."sr_returned_date_sk" = "t19"."d_date_sk" +GROUP BY "t16"."sr_customer_sk", "t16"."sr_store_sk") AS "t20" +GROUP BY "t20"."sr_store_sk" +HAVING CAST(SUM("t20"."$f2") / COUNT("t20"."$f2") AS DECIMAL(19, 6)) IS NOT NULL) AS "t23" ON "t7"."sr_store_sk" = "t23"."ctr_store_sk" AND "t7"."$f2" > "t23"."_o__c0" +ORDER BY "t13"."c_customer_id" +FETCH NEXT 100 ROWS ONLY) AS "t25" + hive.sql.query.fieldNames c_customer_id + hive.sql.query.fieldTypes string + hive.sql.query.split false + Select Operator + expressions: c_customer_id (type: string) + outputColumnNames: _col0 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query10.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query10.q.out new file mode 100644 index 000000000000..7e2491015f4d --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query10.q.out @@ -0,0 +1,267 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Map 9 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: c + properties: + hive.sql.query SELECT "t1"."c_customer_sk", "t1"."c_current_cdemo_sk", "t1"."c_current_addr_sk", "t4"."ca_address_sk", "t4"."ca_county", "t6"."cd_demo_sk", "t6"."cd_gender", "t6"."cd_marital_status", "t6"."cd_education_status", "t6"."cd_purchase_estimate", "t6"."cd_credit_rating", "t6"."cd_dep_count", "t6"."cd_dep_employed_count", "t6"."cd_dep_college_count" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_addr_sk" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_addr_sk" +FROM "customer") AS "t" +WHERE "c_current_addr_sk" IS NOT NULL AND "c_current_cdemo_sk" IS NOT NULL AND "c_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_county" +FROM (SELECT "ca_address_sk", "ca_county" +FROM "customer_address") AS "t2" +WHERE "ca_county" IN ('Dona Ana County', 'Douglas County', 'Gaines County', 'Richland County', 'Walker County') AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."c_current_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "cd_demo_sk", "cd_gender", "cd_marital_status", "cd_education_status", "cd_purchase_estimate", "cd_credit_rating", "cd_dep_count", "cd_dep_employed_count", "cd_dep_college_count" +FROM "customer_demographics" +WHERE "cd_demo_sk" IS NOT NULL) AS "t6" ON "t1"."c_current_cdemo_sk" = "t6"."cd_demo_sk" + hive.sql.query.fieldNames c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,ca_address_sk,ca_county,cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count + hive.sql.query.fieldTypes int,int,int,int,string,int,string,string,string,int,string,int,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 756 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_customer_sk (type: int), cd_gender (type: string), cd_marital_status (type: string), cd_education_status (type: string), cd_purchase_estimate (type: int), cd_credit_rating (type: string), cd_dep_count (type: int), cd_dep_employed_count (type: int), cd_dep_college_count (type: int) + outputColumnNames: _col0, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13 + Statistics: Num rows: 1 Data size: 756 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 756 Basic stats: COMPLETE Column stats: NONE + value expressions: _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: int), _col10 (type: string), _col11 (type: int), _col12 (type: int), _col13 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_customer_sk" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk" +FROM "store_sales") AS "t" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2002 AND "d_moy" BETWEEN 4 AND 7 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames ss_customer_sk + hive.sql.query.fieldTypes int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_customer_sk (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 8 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT TRUE AS "literalTrue", "t1"."ws_bill_customer_sk" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk" +FROM "web_sales") AS "t" +WHERE "ws_bill_customer_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2002 AND "d_moy" BETWEEN 4 AND 7 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_sold_date_sk" = "t4"."d_date_sk" +GROUP BY "t1"."ws_bill_customer_sk" + hive.sql.query.fieldNames literalTrue,ws_bill_customer_sk + hive.sql.query.fieldTypes boolean,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: literaltrue (type: boolean), ws_bill_customer_sk (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT TRUE AS "literalTrue", "t1"."cs_ship_customer_sk" +FROM (SELECT "cs_sold_date_sk", "cs_ship_customer_sk" +FROM (SELECT "cs_sold_date_sk", "cs_ship_customer_sk" +FROM "catalog_sales") AS "t" +WHERE "cs_ship_customer_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2002 AND "d_moy" BETWEEN 4 AND 7 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_sold_date_sk" = "t4"."d_date_sk" +GROUP BY "t1"."cs_ship_customer_sk" + hive.sql.query.fieldNames literalTrue,cs_ship_customer_sk + hive.sql.query.fieldTypes boolean,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: literaltrue (type: boolean), cs_ship_customer_sk (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col0, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13 + Statistics: Num rows: 1 Data size: 831 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 831 Basic stats: COMPLETE Column stats: NONE + value expressions: _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: int), _col10 (type: string), _col11 (type: int), _col12 (type: int), _col13 (type: int) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col1 (type: int) + outputColumnNames: _col0, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14 + Statistics: Num rows: 1 Data size: 914 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 914 Basic stats: COMPLETE Column stats: NONE + value expressions: _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: int), _col10 (type: string), _col11 (type: int), _col12 (type: int), _col13 (type: int), _col14 (type: boolean) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col1 (type: int) + outputColumnNames: _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col16 + Statistics: Num rows: 1 Data size: 1005 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (_col14 is not null or _col16 is not null) (type: boolean) + Statistics: Num rows: 1 Data size: 1005 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++++++++ + keys: _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: int), _col10 (type: string), _col11 (type: int), _col12 (type: int), _col13 (type: int) + null sort order: zzzzzzzz + Statistics: Num rows: 1 Data size: 1005 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: int), _col10 (type: string), _col11 (type: int), _col12 (type: int), _col13 (type: int) + outputColumnNames: _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13 + Statistics: Num rows: 1 Data size: 1005 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count() + keys: _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: int), _col10 (type: string), _col11 (type: int), _col12 (type: int), _col13 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 1 Data size: 1005 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: int), _col4 (type: string), _col5 (type: int), _col6 (type: int), _col7 (type: int) + null sort order: zzzzzzzz + sort order: ++++++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: int), _col4 (type: string), _col5 (type: int), _col6 (type: int), _col7 (type: int) + Statistics: Num rows: 1 Data size: 1005 Basic stats: COMPLETE Column stats: NONE + value expressions: _col8 (type: bigint) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string), KEY._col3 (type: int), KEY._col4 (type: string), KEY._col5 (type: int), KEY._col6 (type: int), KEY._col7 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 1 Data size: 1005 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col8 (type: bigint), _col3 (type: int), _col4 (type: string), _col5 (type: int), _col6 (type: int), _col7 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col6, _col8, _col10, _col12 + Statistics: Num rows: 1 Data size: 1005 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col4 (type: int), _col6 (type: string), _col8 (type: int), _col10 (type: int), _col12 (type: int) + null sort order: zzzzzzzz + sort order: ++++++++ + Statistics: Num rows: 1 Data size: 1005 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), VALUE._col0 (type: bigint), KEY.reducesinkkey3 (type: int), VALUE._col0 (type: bigint), KEY.reducesinkkey4 (type: string), VALUE._col0 (type: bigint), KEY.reducesinkkey5 (type: int), VALUE._col0 (type: bigint), KEY.reducesinkkey6 (type: int), VALUE._col0 (type: bigint), KEY.reducesinkkey7 (type: int), VALUE._col0 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13 + Statistics: Num rows: 1 Data size: 1005 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 1005 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 1005 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query11.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query11.q.out new file mode 100644 index 000000000000..19569ee45494 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query11.q.out @@ -0,0 +1,77 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "t46"."customer_id", "t46"."customer_first_name", "t46"."customer_last_name", "t46"."customer_birth_country" +FROM (SELECT "t44"."customer_id", "t44"."customer_first_name", "t44"."customer_last_name", "t44"."customer_birth_country" +FROM (SELECT "t1"."c_customer_id" AS "customer_id", SUM("t4"."$f8") AS "year_total", SUM("t4"."$f8") > 0 AS "EXPR$0" +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 (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 "customer") AS "t" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t1" +INNER JOIN ((SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_ext_list_price" - "ss_ext_discount_amt" AS "$f8" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_ext_discount_amt", "ss_ext_list_price" +FROM "store_sales") AS "t2" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t4" INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t5" +WHERE "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t7" ON "t4"."ss_sold_date_sk" = "t7"."d_date_sk") ON "t1"."c_customer_sk" = "t4"."ss_customer_sk" +GROUP BY "t1"."c_customer_id", "t1"."c_first_name", "t1"."c_last_name", "t1"."c_preferred_cust_flag", "t1"."c_birth_country", "t1"."c_login", "t1"."c_email_address" +HAVING SUM("t4"."$f8") > 0) AS "t10" +INNER JOIN (SELECT "t13"."c_customer_id" AS "customer_id", SUM("t16"."$f8") AS "year_total" +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 (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 "customer") AS "t11" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t13" +INNER JOIN ((SELECT "ws_sold_date_sk", "ws_bill_customer_sk", "ws_ext_list_price" - "ws_ext_discount_amt" AS "$f8" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk", "ws_ext_discount_amt", "ws_ext_list_price" +FROM "web_sales") AS "t14" +WHERE "ws_bill_customer_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t16" INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t17" +WHERE "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t19" ON "t16"."ws_sold_date_sk" = "t19"."d_date_sk") ON "t13"."c_customer_sk" = "t16"."ws_bill_customer_sk" +GROUP BY "t13"."c_customer_id", "t13"."c_first_name", "t13"."c_last_name", "t13"."c_preferred_cust_flag", "t13"."c_birth_country", "t13"."c_login", "t13"."c_email_address") AS "t21" ON "t10"."customer_id" = "t21"."customer_id" +INNER JOIN (SELECT "t24"."c_customer_id" AS "customer_id", SUM("t27"."$f8") AS "year_total", SUM("t27"."$f8") > 0 AS "EXPR$1" +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 (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 "customer") AS "t22" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t24" +INNER JOIN ((SELECT "ws_sold_date_sk", "ws_bill_customer_sk", "ws_ext_list_price" - "ws_ext_discount_amt" AS "$f8" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk", "ws_ext_discount_amt", "ws_ext_list_price" +FROM "web_sales") AS "t25" +WHERE "ws_bill_customer_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t27" INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t28" +WHERE "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t30" ON "t27"."ws_sold_date_sk" = "t30"."d_date_sk") ON "t24"."c_customer_sk" = "t27"."ws_bill_customer_sk" +GROUP BY "t24"."c_customer_id", "t24"."c_first_name", "t24"."c_last_name", "t24"."c_preferred_cust_flag", "t24"."c_birth_country", "t24"."c_login", "t24"."c_email_address" +HAVING SUM("t27"."$f8") > 0) AS "t33" ON "t10"."customer_id" = "t33"."customer_id" +INNER JOIN (SELECT "t36"."c_customer_id" AS "customer_id", "t36"."c_first_name" AS "customer_first_name", "t36"."c_last_name" AS "customer_last_name", "t36"."c_birth_country" AS "customer_birth_country", SUM("t39"."$f8") AS "year_total" +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 (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 "customer") AS "t34" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t36" +INNER JOIN ((SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_ext_list_price" - "ss_ext_discount_amt" AS "$f8" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_ext_discount_amt", "ss_ext_list_price" +FROM "store_sales") AS "t37" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t39" INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t40" +WHERE "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t42" ON "t39"."ss_sold_date_sk" = "t42"."d_date_sk") ON "t36"."c_customer_sk" = "t39"."ss_customer_sk" +GROUP BY "t36"."c_customer_id", "t36"."c_first_name", "t36"."c_last_name", "t36"."c_preferred_cust_flag", "t36"."c_birth_country", "t36"."c_login", "t36"."c_email_address") AS "t44" ON "t10"."customer_id" = "t44"."customer_id" AND CASE WHEN "t10"."EXPR$0" THEN CASE WHEN "t33"."EXPR$1" THEN "t21"."year_total" / "t33"."year_total" > "t44"."year_total" / "t10"."year_total" ELSE 0 > "t44"."year_total" / "t10"."year_total" END ELSE CASE WHEN "t33"."EXPR$1" THEN "t21"."year_total" / "t33"."year_total" > 0 ELSE FALSE END END +ORDER BY "t44"."customer_id", "t44"."customer_first_name", "t44"."customer_last_name", "t44"."customer_birth_country" +FETCH NEXT 100 ROWS ONLY) AS "t46" + hive.sql.query.fieldNames customer_id,customer_first_name,customer_last_name,customer_birth_country + hive.sql.query.fieldTypes string,string,string,string + hive.sql.query.split false + Select Operator + expressions: customer_id (type: string), customer_first_name (type: string), customer_last_name (type: string), customer_birth_country (type: string) + outputColumnNames: _col0, _col1, _col2, _col3 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query12.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query12.q.out new file mode 100644 index 000000000000..70e1eba98b2c --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query12.q.out @@ -0,0 +1,116 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t7"."i_item_id", "t7"."i_item_desc", "t7"."i_current_price", "t7"."i_class", "t7"."i_category", SUM("t1"."ws_ext_sales_price") AS "$f5" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_ext_sales_price" +FROM "web_sales") AS "t" +WHERE "ws_item_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t2" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '2001-01-12 00:00:00.000000000' AND TIMESTAMP '2001-02-11 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id", "i_item_desc", "i_current_price", "i_class", "i_category" +FROM (SELECT "i_item_sk", "i_item_id", "i_item_desc", "i_current_price", "i_class", "i_category" +FROM "item") AS "t5" +WHERE "i_category" IN ('Books', 'Jewelry', 'Sports') AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ws_item_sk" = "t7"."i_item_sk" +GROUP BY "t7"."i_item_id", "t7"."i_item_desc", "t7"."i_current_price", "t7"."i_class", "t7"."i_category" + hive.sql.query.fieldNames i_item_id,i_item_desc,i_current_price,i_class,i_category,$f5 + hive.sql.query.fieldTypes string,string,decimal(7,2),string,string,decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_id (type: string), i_item_desc (type: string), i_current_price (type: decimal(7,2)), i_class (type: string), i_category (type: string), $f5 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: string) + null sort order: a + sort order: + + Map-reduce partition columns: _col3 (type: string) + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: decimal(7,2)), _col4 (type: string), _col5 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: string), VALUE._col1 (type: string), VALUE._col2 (type: decimal(7,2)), KEY.reducesinkkey0 (type: string), VALUE._col3 (type: string), VALUE._col4 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: string, _col2: decimal(7,2), _col3: string, _col4: string, _col5: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col3 ASC NULLS FIRST + partition by: _col3 + raw input shape: + window functions: + window function definition + alias: sum_window_0 + arguments: _col5 + name: sum + window function: GenericUDAFSumHiveDecimal + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +++++ + keys: _col4 (type: string), _col3 (type: string), _col0 (type: string), _col1 (type: string), ((_col5 * 100) / sum_window_0) (type: decimal(38,17)) + null sort order: zzzzz + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col1 (type: string), _col4 (type: string), _col3 (type: string), _col2 (type: decimal(7,2)), _col5 (type: decimal(17,2)), ((_col5 * 100) / sum_window_0) (type: decimal(38,17)), _col0 (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: string), _col2 (type: string), _col6 (type: string), _col0 (type: string), _col5 (type: decimal(38,17)) + null sort order: zzzzz + sort order: +++++ + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)), _col4 (type: decimal(17,2)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey3 (type: string), KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), VALUE._col0 (type: decimal(7,2)), VALUE._col1 (type: decimal(17,2)), KEY.reducesinkkey4 (type: decimal(38,17)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query13.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query13.q.out new file mode 100644 index 000000000000..fd4caba87eac --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query13.q.out @@ -0,0 +1,44 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("t1"."ss_quantity") AS DOUBLE PRECISION) / COUNT("t1"."ss_quantity") AS "_o__c0", CAST(SUM("t1"."ss_ext_sales_price") / COUNT("t1"."ss_ext_sales_price") AS DECIMAL(11, 6)) AS "_o__c1", CAST(SUM("t1"."ss_ext_wholesale_cost") / COUNT("t1"."ss_ext_wholesale_cost") AS DECIMAL(11, 6)) AS "_o__c2", SUM("t1"."ss_ext_wholesale_cost") AS "_o__c3" +FROM (SELECT "ss_sold_date_sk", "ss_cdemo_sk", "ss_hdemo_sk", "ss_addr_sk", "ss_store_sk", "ss_quantity", "ss_ext_sales_price", "ss_ext_wholesale_cost", "ss_net_profit" BETWEEN 100 AND 200 AS "EXPR$0", "ss_net_profit" BETWEEN 150 AND 300 AS "EXPR$1", "ss_net_profit" BETWEEN 50 AND 250 AS "EXPR$2", "ss_sales_price" BETWEEN 100 AND 150 AS "EXPR$5", "ss_sales_price" BETWEEN 50 AND 100 AS "EXPR$8", "ss_sales_price" BETWEEN 150 AND 200 AS "EXPR$11" +FROM (SELECT "ss_sold_date_sk", "ss_cdemo_sk", "ss_hdemo_sk", "ss_addr_sk", "ss_store_sk", "ss_quantity", "ss_sales_price", "ss_ext_sales_price", "ss_ext_wholesale_cost", "ss_net_profit" +FROM "store_sales") AS "t" +WHERE "ss_sales_price" IS NOT NULL AND ("ss_net_profit" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AND ("ss_cdemo_sk" IS NOT NULL AND "ss_hdemo_sk" IS NOT NULL AND ("ss_addr_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL))) AS "t1" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk" +FROM "store") AS "t2" +WHERE "s_store_sk" IS NOT NULL) AS "t4" ON "t1"."ss_store_sk" = "t4"."s_store_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t5" +WHERE "d_year" = 2001 AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_date_sk" = "t7"."d_date_sk" +INNER JOIN (SELECT "hd_demo_sk", "hd_dep_count" = 3 AS "EXPR$0", "hd_dep_count" = 1 AS "EXPR$1" +FROM (SELECT "hd_demo_sk", "hd_dep_count" +FROM "household_demographics") AS "t8" +WHERE "hd_dep_count" IN (1, 3) AND "hd_demo_sk" IS NOT NULL) AS "t10" ON "t1"."ss_hdemo_sk" = "t10"."hd_demo_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_state" IN ('GA', 'KY', 'NM') AS "EXPR$0", "ca_state" IN ('IN', 'MT', 'OR') AS "EXPR$1", "ca_state" IN ('MO', 'WI', 'WV') AS "EXPR$2" +FROM (SELECT "ca_address_sk", "ca_state", "ca_country" +FROM "customer_address") AS "t11" +WHERE "ca_state" IN ('GA', 'IN', 'KY', 'MO', 'MT', 'NM', 'OR', 'WI', 'WV') AND "ca_country" = 'United States' AND "ca_address_sk" IS NOT NULL) AS "t13" ON "t1"."ss_addr_sk" = "t13"."ca_address_sk" AND ("t13"."EXPR$0" AND "t1"."EXPR$0" OR "t13"."EXPR$1" AND "t1"."EXPR$1" OR "t13"."EXPR$2" AND "t1"."EXPR$2") +INNER JOIN (SELECT "cd_demo_sk", "cd_marital_status" = 'M' AS "EXPR$3", "cd_education_status" = '4 yr Degree' AS "EXPR$4", "cd_marital_status" = 'D' AS "EXPR$6", "cd_education_status" = 'Primary' AS "EXPR$7", "cd_marital_status" = 'U' AS "EXPR$9", "cd_education_status" = 'Advanced Degree' AS "EXPR$10" +FROM (SELECT "cd_demo_sk", "cd_marital_status", "cd_education_status" +FROM "customer_demographics") AS "t14" +WHERE "cd_marital_status" IN ('D', 'M', 'U') AND "cd_education_status" IN ('4 yr Degree', 'Advanced Degree', 'Primary') AND "cd_demo_sk" IS NOT NULL) AS "t16" ON "t1"."ss_cdemo_sk" = "t16"."cd_demo_sk" AND ("t16"."EXPR$3" AND "t16"."EXPR$4" AND "t1"."EXPR$5" AND "t10"."EXPR$0" OR "t16"."EXPR$6" AND "t16"."EXPR$7" AND "t1"."EXPR$8" AND "t10"."EXPR$1" OR "t16"."EXPR$9" AND "t16"."EXPR$10" AND "t1"."EXPR$11" AND "t10"."EXPR$1") + hive.sql.query.fieldNames _o__c0,_o__c1,_o__c2,_o__c3 + hive.sql.query.fieldTypes double,decimal(11,6),decimal(11,6),decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: _o__c0 (type: double), _o__c1 (type: decimal(11,6)), _o__c2 (type: decimal(11,6)), _o__c3 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query14.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query14.q.out new file mode 100644 index 000000000000..061f24d57d34 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query14.q.out @@ -0,0 +1,791 @@ +Warning: Shuffle Join MERGEJOIN[334][tables = [$hdt$_1, $hdt$_2]] in Stage 'Reducer 28' is a cross product +Warning: Shuffle Join MERGEJOIN[340][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 'Reducer 9' is a cross product +Warning: Shuffle Join MERGEJOIN[346][tables = [$hdt$_2, $hdt$_3, $hdt$_1]] in Stage 'Reducer 17' is a cross product +Warning: Shuffle Join MERGEJOIN[352][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 'Reducer 20' is a cross product +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-2 depends on stages: Stage-1 + Stage-4 depends on stages: Stage-2, Stage-0 + Stage-0 depends on stages: Stage-1 + Stage-3 depends on stages: Stage-4 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Map 1 <- Union 2 (CONTAINS) + Map 4 <- Union 2 (CONTAINS) + Map 5 <- Union 2 (CONTAINS) + Reducer 3 <- Union 2 (CUSTOM_SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: quantity (type: int), list_price (type: decimal(7,2)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: (CAST( _col0 AS decimal(10,0)) * _col1) (type: decimal(18,2)) + outputColumnNames: _col0 + Statistics: Num rows: 3 Data size: 348 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col0), count(_col0) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(28,2)), _col1 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 4 + Map Operator Tree: + TableScan + alias: catalog_sales + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: quantity (type: int), list_price (type: decimal(7,2)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: (CAST( _col0 AS decimal(10,0)) * _col1) (type: decimal(18,2)) + outputColumnNames: _col0 + Statistics: Num rows: 3 Data size: 348 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col0), count(_col0) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(28,2)), _col1 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 5 + Map Operator Tree: + TableScan + alias: web_sales + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: quantity (type: int), list_price (type: decimal(7,2)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: (CAST( _col0 AS decimal(10,0)) * _col1) (type: decimal(18,2)) + outputColumnNames: _col0 + Statistics: Num rows: 3 Data size: 348 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col0), count(_col0) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(28,2)), _col1 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), count(VALUE._col1) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: CAST( (_col0 / _col1) AS decimal(22,6)) (type: decimal(22,6)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + name: default.avg_sales + Union 2 + Vertex: Union 2 + + Stage: Stage-2 + Dependency Collection + + Stage: Stage-4 + Tez +#### A masked pattern was here #### + Edges: + Map 21 <- Union 22 (CONTAINS) + Map 24 <- Union 22 (CONTAINS) + Map 25 <- Union 22 (CONTAINS) + Reducer 11 <- Union 10 (SIMPLE_EDGE) + Reducer 12 <- Reducer 11 (SIMPLE_EDGE) + Reducer 14 <- Map 13 (SIMPLE_EDGE), Reducer 23 (SIMPLE_EDGE) + Reducer 15 <- Map 30 (SIMPLE_EDGE), Reducer 14 (SIMPLE_EDGE) + Reducer 16 <- Reducer 15 (SIMPLE_EDGE) + Reducer 17 <- Reducer 16 (XPROD_EDGE), Reducer 28 (XPROD_EDGE), Union 10 (CONTAINS) + Reducer 18 <- Map 29 (SIMPLE_EDGE), Reducer 14 (SIMPLE_EDGE) + Reducer 19 <- Reducer 18 (SIMPLE_EDGE) + Reducer 20 <- Reducer 19 (XPROD_EDGE), Reducer 28 (XPROD_EDGE), Union 10 (CONTAINS) + Reducer 23 <- Union 22 (SIMPLE_EDGE) + Reducer 27 <- Map 26 (CUSTOM_SIMPLE_EDGE) + Reducer 28 <- Map 26 (XPROD_EDGE), Reducer 27 (XPROD_EDGE) + Reducer 7 <- Map 6 (SIMPLE_EDGE), Reducer 14 (SIMPLE_EDGE) + Reducer 8 <- Reducer 7 (SIMPLE_EDGE) + Reducer 9 <- Reducer 28 (XPROD_EDGE), Reducer 8 (XPROD_EDGE), Union 10 (CONTAINS) +#### A masked pattern was here #### + Vertices: + Map 13 + Map Operator Tree: + TableScan + alias: item + properties: + hive.sql.query SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id" +FROM (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id" +FROM "item") AS "t" +WHERE "i_brand_id" IS NOT NULL AND "i_class_id" IS NOT NULL AND "i_category_id" IS NOT NULL AND "i_item_sk" IS NOT NULL + hive.sql.query.fieldNames i_item_sk,i_brand_id,i_class_id,i_category_id + hive.sql.query.fieldTypes bigint,int,int,int + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_sk (type: bigint), i_brand_id (type: int), i_class_id (type: int), i_category_id (type: int) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int), _col2 (type: int), _col3 (type: int) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col1 (type: int), _col2 (type: int), _col3 (type: int) + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 21 + Map Operator Tree: + TableScan + alias: store_sales + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_brand_id (type: int), i_class_id (type: int), i_category_id (type: int), $f3 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count(_col3) + keys: _col0 (type: int), _col1 (type: int), _col2 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 3 Data size: 60 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: int), _col2 (type: int) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: int), _col2 (type: int) + Statistics: Num rows: 3 Data size: 60 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 24 + Map Operator Tree: + TableScan + alias: catalog_sales + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_brand_id (type: int), i_class_id (type: int), i_category_id (type: int), $f3 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count(_col3) + keys: _col0 (type: int), _col1 (type: int), _col2 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 3 Data size: 60 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: int), _col2 (type: int) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: int), _col2 (type: int) + Statistics: Num rows: 3 Data size: 60 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 25 + Map Operator Tree: + TableScan + alias: web_sales + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_brand_id (type: int), i_class_id (type: int), i_category_id (type: int), $f3 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count(_col3) + keys: _col0 (type: int), _col1 (type: int), _col2 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 3 Data size: 60 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: int), _col2 (type: int) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: int), _col2 (type: int) + Statistics: Num rows: 3 Data size: 60 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 26 + Map Operator Tree: + TableScan + alias: avg_sales + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Select Operator + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count() + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Filter Operator + predicate: average_sales is not null (type: boolean) + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: average_sales (type: decimal(22,6)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(22,6)) + Execution mode: vectorized, llap + LLAP IO: all inputs + Map 29 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t1"."cs_sold_date_sk", "t1"."cs_item_sk", "t1"."cs_quantity", "t1"."cs_list_price", "t7"."i_item_sk", "t7"."i_brand_id", "t7"."i_class_id", "t7"."i_category_id", "t4"."d_date_sk", "t4"."d_year", "t4"."d_moy" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_quantity", "cs_list_price" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_quantity", "cs_list_price" +FROM "catalog_sales") AS "t" +WHERE "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2000 AND "d_moy" = 11 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id" +FROM (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id" +FROM "item") AS "t5" +WHERE "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."cs_item_sk" = "t7"."i_item_sk" + hive.sql.query.fieldNames cs_sold_date_sk,cs_item_sk,cs_quantity,cs_list_price,i_item_sk,i_brand_id,i_class_id,i_category_id,d_date_sk,d_year,d_moy + hive.sql.query.fieldTypes int,bigint,int,decimal(7,2),bigint,int,int,int,int,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 136 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_item_sk (type: bigint), cs_quantity (type: int), cs_list_price (type: decimal(7,2)), i_brand_id (type: int), i_class_id (type: int), i_category_id (type: int) + outputColumnNames: _col1, _col2, _col3, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 136 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: bigint) + Statistics: Num rows: 1 Data size: 136 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: int), _col3 (type: decimal(7,2)), _col5 (type: int), _col6 (type: int), _col7 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 30 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t1"."ws_sold_date_sk", "t1"."ws_item_sk", "t1"."ws_quantity", "t1"."ws_list_price", "t7"."i_item_sk", "t7"."i_brand_id", "t7"."i_class_id", "t7"."i_category_id", "t4"."d_date_sk", "t4"."d_year", "t4"."d_moy" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_quantity", "ws_list_price" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_quantity", "ws_list_price" +FROM "web_sales") AS "t" +WHERE "ws_item_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2000 AND "d_moy" = 11 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id" +FROM (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id" +FROM "item") AS "t5" +WHERE "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ws_item_sk" = "t7"."i_item_sk" + hive.sql.query.fieldNames ws_sold_date_sk,ws_item_sk,ws_quantity,ws_list_price,i_item_sk,i_brand_id,i_class_id,i_category_id,d_date_sk,d_year,d_moy + hive.sql.query.fieldTypes int,bigint,int,decimal(7,2),bigint,int,int,int,int,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 136 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_item_sk (type: bigint), ws_quantity (type: int), ws_list_price (type: decimal(7,2)), i_brand_id (type: int), i_class_id (type: int), i_category_id (type: int) + outputColumnNames: _col1, _col2, _col3, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 136 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: bigint) + Statistics: Num rows: 1 Data size: 136 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: int), _col3 (type: decimal(7,2)), _col5 (type: int), _col6 (type: int), _col7 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_sold_date_sk", "t1"."ss_item_sk", "t1"."ss_quantity", "t1"."ss_list_price", "t7"."i_item_sk", "t7"."i_brand_id", "t7"."i_class_id", "t7"."i_category_id", "t4"."d_date_sk", "t4"."d_year", "t4"."d_moy" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_quantity", "ss_list_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_quantity", "ss_list_price" +FROM "store_sales") AS "t" +WHERE "ss_item_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2000 AND "d_moy" = 11 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id" +FROM (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id" +FROM "item") AS "t5" +WHERE "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" + hive.sql.query.fieldNames ss_sold_date_sk,ss_item_sk,ss_quantity,ss_list_price,i_item_sk,i_brand_id,i_class_id,i_category_id,d_date_sk,d_year,d_moy + hive.sql.query.fieldTypes int,bigint,int,decimal(7,2),bigint,int,int,int,int,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 136 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_item_sk (type: bigint), ss_quantity (type: int), ss_list_price (type: decimal(7,2)), i_brand_id (type: int), i_class_id (type: int), i_category_id (type: int) + outputColumnNames: _col1, _col2, _col3, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 136 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: bigint) + Statistics: Num rows: 1 Data size: 136 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: int), _col3 (type: decimal(7,2)), _col5 (type: int), _col6 (type: int), _col7 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 11 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1) + keys: KEY._col0 (type: string), KEY._col1 (type: int), KEY._col2 (type: int), KEY._col3 (type: int), KEY._col4 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col5, _col6 + Statistics: Num rows: 7 Data size: 4361 Basic stats: COMPLETE Column stats: NONE + pruneGroupingSetId: true + Select Operator + expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), _col5 (type: decimal(38,2)), _col6 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 7 Data size: 4361 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int) + null sort order: zzzz + sort order: ++++ + Statistics: Num rows: 7 Data size: 4361 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: decimal(38,2)), _col5 (type: bigint) + Reducer 12 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: int), KEY.reducesinkkey2 (type: int), KEY.reducesinkkey3 (type: int), VALUE._col0 (type: decimal(38,2)), VALUE._col1 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 7 Data size: 4361 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 7 Data size: 4361 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 7 Data size: 4361 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 14 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col1 (type: int), _col2 (type: int), _col3 (type: int) + 1 _col0 (type: int), _col1 (type: int), _col2 (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 22 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 22 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 22 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 22 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 22 Basic stats: COMPLETE Column stats: NONE + Reducer 15 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col1 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col2, _col3, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col5 (type: int), _col6 (type: int), _col7 (type: int), (CAST( _col2 AS decimal(10,0)) * _col3) (type: decimal(18,2)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3), count() + keys: _col0 (type: int), _col1 (type: int), _col2 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: int), _col2 (type: int) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: int), _col2 (type: int) + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(28,2)), _col4 (type: bigint) + Reducer 16 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), count(VALUE._col1) + keys: KEY._col0 (type: int), KEY._col1 (type: int), KEY._col2 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: _col3 is not null (type: boolean) + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col1 (type: int), _col2 (type: int), _col3 (type: decimal(28,2)), _col4 (type: bigint) + Reducer 17 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6 + residual filter predicates: {(_col5 > _col1)} + Statistics: Num rows: 1 Data size: 623 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'web' (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: int), _col5 (type: decimal(28,2)), _col6 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 623 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++++ + keys: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int) + null sort order: zzzz + Statistics: Num rows: 3 Data size: 1869 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col4), sum(_col5) + keys: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), 0L (type: bigint) + grouping sets: 0, 1, 3, 7, 15 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 15 Data size: 9345 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), _col4 (type: bigint) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), _col4 (type: bigint) + Statistics: Num rows: 15 Data size: 9345 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: decimal(38,2)), _col6 (type: bigint) + Reducer 18 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col1 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col2, _col3, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col5 (type: int), _col6 (type: int), _col7 (type: int), (CAST( _col2 AS decimal(10,0)) * _col3) (type: decimal(18,2)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3), count() + keys: _col0 (type: int), _col1 (type: int), _col2 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: int), _col2 (type: int) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: int), _col2 (type: int) + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(28,2)), _col4 (type: bigint) + Reducer 19 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), count(VALUE._col1) + keys: KEY._col0 (type: int), KEY._col1 (type: int), KEY._col2 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: _col3 is not null (type: boolean) + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col1 (type: int), _col2 (type: int), _col3 (type: decimal(28,2)), _col4 (type: bigint) + Reducer 20 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6 + residual filter predicates: {(_col5 > _col1)} + Statistics: Num rows: 1 Data size: 623 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'catalog' (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: int), _col5 (type: decimal(28,2)), _col6 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 623 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++++ + keys: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int) + null sort order: zzzz + Statistics: Num rows: 3 Data size: 1869 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col4), sum(_col5) + keys: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), 0L (type: bigint) + grouping sets: 0, 1, 3, 7, 15 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 15 Data size: 9345 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), _col4 (type: bigint) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), _col4 (type: bigint) + Statistics: Num rows: 15 Data size: 9345 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: decimal(38,2)), _col6 (type: bigint) + Reducer 23 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + keys: KEY._col0 (type: int), KEY._col1 (type: int), KEY._col2 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (_col3 = 3L) (type: boolean) + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: int), _col1 (type: int), _col2 (type: int) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: int), _col2 (type: int) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: int), _col2 (type: int) + Statistics: Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: NONE + Reducer 27 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + mode: mergepartial + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: sq_count_check(_col0) (type: boolean) + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Select Operator + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Reducer 28 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1 + Statistics: Num rows: 1 Data size: 473 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 473 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(22,6)) + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 473 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(22,6)) + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 473 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(22,6)) + Reducer 7 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col1 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col2, _col3, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col5 (type: int), _col6 (type: int), _col7 (type: int), (CAST( _col2 AS decimal(10,0)) * _col3) (type: decimal(18,2)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3), count() + keys: _col0 (type: int), _col1 (type: int), _col2 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: int), _col2 (type: int) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: int), _col2 (type: int) + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(28,2)), _col4 (type: bigint) + Reducer 8 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), count(VALUE._col1) + keys: KEY._col0 (type: int), KEY._col1 (type: int), KEY._col2 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: _col3 is not null (type: boolean) + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col1 (type: int), _col2 (type: int), _col3 (type: decimal(28,2)), _col4 (type: bigint) + Reducer 9 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6 + residual filter predicates: {(_col5 > _col1)} + Statistics: Num rows: 1 Data size: 623 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'store' (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: int), _col5 (type: decimal(28,2)), _col6 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 623 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++++ + keys: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int) + null sort order: zzzz + Statistics: Num rows: 3 Data size: 1869 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col4), sum(_col5) + keys: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), 0L (type: bigint) + grouping sets: 0, 1, 3, 7, 15 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 15 Data size: 9345 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), _col4 (type: bigint) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), _col4 (type: bigint) + Statistics: Num rows: 15 Data size: 9345 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: decimal(38,2)), _col6 (type: bigint) + Union 10 + Vertex: Union 10 + Union 22 + Vertex: Union 22 + + Stage: Stage-0 + Move Operator + files: + hdfs directory: true +#### A masked pattern was here #### + + Stage: Stage-3 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query15.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query15.q.out new file mode 100644 index 000000000000..d4634784b7e9 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query15.q.out @@ -0,0 +1,191 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE) + Reducer 3 <- Map 7 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: customer_address + properties: + hive.sql.query SELECT "ca_address_sk", "ca_state", "ca_zip" +FROM (SELECT "ca_address_sk", "ca_state", "ca_zip" +FROM "customer_address") AS "t" +WHERE "ca_address_sk" IS NOT NULL + hive.sql.query.fieldNames ca_address_sk,ca_state,ca_zip + hive.sql.query.fieldTypes int,string,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ca_address_sk (type: int), ca_zip (type: string), (ca_state) IN ('CA', 'GA', 'WA') (type: boolean), (substr(ca_zip, 1, 5)) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792') (type: boolean) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string), _col2 (type: boolean), _col3 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "c_customer_sk", "c_current_addr_sk" +FROM (SELECT "c_customer_sk", "c_current_addr_sk" +FROM "customer") AS "t" +WHERE "c_customer_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL + hive.sql.query.fieldNames c_customer_sk,c_current_addr_sk + hive.sql.query.fieldTypes int,int + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_customer_sk (type: int), c_current_addr_sk (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t1"."cs_sold_date_sk", "t1"."cs_bill_customer_sk", "t1"."cs_sales_price", "t1"."EXPR$0", "t4"."d_date_sk" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_sales_price", "cs_sales_price" > 500 AS "EXPR$0" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_sales_price" +FROM "catalog_sales") AS "t" +WHERE "cs_bill_customer_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_qoy" +FROM "date_dim") AS "t2" +WHERE "d_qoy" = 2 AND "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_sold_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames cs_sold_date_sk,cs_bill_customer_sk,cs_sales_price,EXPR$0,d_date_sk + hive.sql.query.fieldTypes int,int,decimal(7,2),boolean,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_bill_customer_sk (type: int), cs_sales_price (type: decimal(7,2)), expr$0 (type: boolean) + outputColumnNames: _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(7,2)), _col3 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col1 (type: int) + outputColumnNames: _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col4 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col4 (type: int) + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string), _col2 (type: boolean), _col3 (type: boolean) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col4 (type: int) + 1 _col1 (type: int) + outputColumnNames: _col1, _col2, _col3, _col8, _col9 + residual filter predicates: {(_col2 or _col9 or _col3)} + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: + + keys: _col1 (type: string) + null sort order: z + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col1 (type: string), _col8 (type: decimal(7,2)) + outputColumnNames: _col1, _col8 + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col8) + keys: _col1 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: decimal(17,2)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query16.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query16.q.out new file mode 100644 index 000000000000..1794b783ce06 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query16.q.out @@ -0,0 +1,206 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE) + Reducer 3 <- Map 7 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (CUSTOM_SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: cs1 + properties: + hive.sql.query SELECT "t1"."cs_ship_date_sk", "t1"."cs_ship_addr_sk", "t1"."cs_call_center_sk", "t1"."cs_warehouse_sk", "t1"."cs_order_number", "t1"."cs_ext_ship_cost", "t1"."cs_net_profit", "t4"."d_date_sk", "t4"."d_date", "t7"."ca_address_sk", "t7"."ca_state", "t10"."cc_call_center_sk", "t10"."cc_county" +FROM (SELECT "cs_ship_date_sk", "cs_ship_addr_sk", "cs_call_center_sk", "cs_warehouse_sk", "cs_order_number", "cs_ext_ship_cost", "cs_net_profit" +FROM (SELECT "cs_ship_date_sk", "cs_ship_addr_sk", "cs_call_center_sk", "cs_warehouse_sk", "cs_order_number", "cs_ext_ship_cost", "cs_net_profit" +FROM "catalog_sales") AS "t" +WHERE "cs_ship_date_sk" IS NOT NULL AND "cs_ship_addr_sk" IS NOT NULL AND "cs_call_center_sk" IS NOT NULL AND "cs_order_number" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t2" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '2001-04-01 00:00:00.000000000' AND TIMESTAMP '2001-05-31 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_ship_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_state" +FROM (SELECT "ca_address_sk", "ca_state" +FROM "customer_address") AS "t5" +WHERE "ca_state" = 'NY' AND "ca_address_sk" IS NOT NULL) AS "t7" ON "t1"."cs_ship_addr_sk" = "t7"."ca_address_sk" +INNER JOIN (SELECT "cc_call_center_sk", "cc_county" +FROM (SELECT "cc_call_center_sk", "cc_county" +FROM "call_center") AS "t8" +WHERE "cc_county" IN ('Daviess County', 'Franklin Parish', 'Huron County', 'Levy County', 'Ziebach County') AND "cc_call_center_sk" IS NOT NULL) AS "t10" ON "t1"."cs_call_center_sk" = "t10"."cc_call_center_sk" + hive.sql.query.fieldNames cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk,cs_warehouse_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit,d_date_sk,d_date,ca_address_sk,ca_state,cc_call_center_sk,cc_county + hive.sql.query.fieldTypes int,int,int,int,bigint,decimal(7,2),decimal(7,2),int,string,int,string,int,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_warehouse_sk (type: int), cs_order_number (type: bigint), cs_ext_ship_cost (type: decimal(7,2)), cs_net_profit (type: decimal(7,2)) + outputColumnNames: _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col4 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col4 (type: bigint) + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: cs2 + properties: + hive.sql.query SELECT "cs_warehouse_sk", "cs_order_number" +FROM (SELECT "cs_warehouse_sk", "cs_order_number" +FROM "catalog_sales") AS "t" +WHERE "cs_order_number" IS NOT NULL AND "cs_warehouse_sk" IS NOT NULL + hive.sql.query.fieldNames cs_warehouse_sk,cs_order_number + hive.sql.query.fieldTypes int,bigint + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_order_number (type: bigint), cs_warehouse_sk (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: bigint), _col1 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: cr1 + properties: + hive.sql.query SELECT TRUE AS "literalTrue", "cr_order_number" +FROM (SELECT "cr_order_number" +FROM "catalog_returns") AS "t" +WHERE "cr_order_number" IS NOT NULL + hive.sql.query.fieldNames literalTrue,cr_order_number + hive.sql.query.fieldTypes boolean,bigint + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cr_order_number (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col4 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col3, _col4, _col5, _col6, _col14 + residual filter predicates: {(_col3 <> _col14)} + Statistics: Num rows: 1 Data size: 259 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col4 (type: bigint), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)) + outputColumnNames: _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 259 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col4 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col4 (type: bigint) + Statistics: Num rows: 1 Data size: 259 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Anti Join 0 to 1 + keys: + 0 _col4 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 284 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col5), sum(_col6) + keys: _col4 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col2, _col3 + Statistics: Num rows: 1 Data size: 284 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 284 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(17,2)), _col3 (type: decimal(17,2)) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1) + keys: KEY._col0 (type: bigint) + mode: partial2 + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 284 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count(_col0), sum(_col1), sum(_col2) + mode: partial2 + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 344 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 344 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: decimal(17,2)), _col2 (type: decimal(17,2)) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0), sum(VALUE._col1), sum(VALUE._col2) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 344 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 344 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query17.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query17.q.out new file mode 100644 index 000000000000..6d5d3d86c62f --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query17.q.out @@ -0,0 +1,58 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t28"."i_item_id", "t28"."i_item_desc", "t28"."s_state", "t28"."store_sales_quantitycount", "t28"."store_sales_quantityave", "t28"."store_sales_quantitystdev", "t28"."store_sales_quantitycov", "t28"."as_store_returns_quantitycount", "t28"."as_store_returns_quantityave", "t28"."as_store_returns_quantitystdev", "t28"."store_returns_quantitycov", "t28"."catalog_sales_quantitycount", "t28"."catalog_sales_quantityave", "t28"."catalog_sales_quantitystdev", "t28"."catalog_sales_quantitycov" +FROM (SELECT "t10"."i_item_id", "t10"."i_item_desc", "t7"."s_state", COUNT("t1"."ss_quantity") AS "store_sales_quantitycount", CAST(SUM("t1"."ss_quantity") AS DOUBLE PRECISION) / COUNT("t1"."ss_quantity") AS "store_sales_quantityave", POWER((SUM(CAST("t1"."ss_quantity" AS DOUBLE PRECISION) * CAST("t1"."ss_quantity" AS DOUBLE PRECISION)) - SUM(CAST("t1"."ss_quantity" AS DOUBLE PRECISION)) * SUM(CAST("t1"."ss_quantity" AS DOUBLE PRECISION)) / COUNT(CAST("t1"."ss_quantity" AS DOUBLE PRECISION))) / CASE WHEN COUNT(CAST("t1"."ss_quantity" AS DOUBLE PRECISION)) = 1 THEN NULL ELSE COUNT(CAST("t1"."ss_quantity" AS DOUBLE PRECISION)) - 1 END, 0.5) AS "store_sales_quantitystdev", POWER((SUM(CAST("t1"."ss_quantity" AS DOUBLE PRECISION) * CAST("t1"."ss_quantity" AS DOUBLE PRECISION)) - SUM(CAST("t1"."ss_quantity" AS DOUBLE PRECISION)) * SUM(CAST("t1"."ss_quantity" AS DOUBLE PRECISION)) / COUNT(CAST("t1"."ss_quantity" AS DOUBLE PRECISION))) / CASE WHEN COUNT(CAST("t1"."ss_quantity" AS DOUBLE PRECISION)) = 1 THEN NULL ELSE COUNT(CAST("t1"."ss_quantity" AS DOUBLE PRECISION)) - 1 END, 0.5) / (CAST(SUM("t1"."ss_quantity") AS DOUBLE PRECISION) / COUNT("t1"."ss_quantity")) AS "store_sales_quantitycov", COUNT("t24"."sr_return_quantity") AS "as_store_returns_quantitycount", CAST(SUM("t24"."sr_return_quantity") AS DOUBLE PRECISION) / COUNT("t24"."sr_return_quantity") AS "as_store_returns_quantityave", POWER((SUM(CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION) * CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION)) - SUM(CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION)) * SUM(CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION)) / COUNT(CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION))) / CASE WHEN COUNT(CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION)) = 1 THEN NULL ELSE COUNT(CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION)) - 1 END, 0.5) AS "as_store_returns_quantitystdev", POWER((SUM(CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION) * CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION)) - SUM(CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION)) * SUM(CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION)) / COUNT(CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION))) / CASE WHEN COUNT(CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION)) = 1 THEN NULL ELSE COUNT(CAST("t24"."sr_return_quantity" AS DOUBLE PRECISION)) - 1 END, 0.5) / (CAST(SUM("t24"."sr_return_quantity") AS DOUBLE PRECISION) / COUNT("t24"."sr_return_quantity")) AS "store_returns_quantitycov", COUNT("t24"."cs_quantity") AS "catalog_sales_quantitycount", CAST(SUM("t24"."cs_quantity") AS DOUBLE PRECISION) / COUNT("t24"."cs_quantity") AS "catalog_sales_quantityave", POWER((SUM(CAST("t24"."cs_quantity" AS DOUBLE PRECISION) * CAST("t24"."cs_quantity" AS DOUBLE PRECISION)) - SUM(CAST("t24"."cs_quantity" AS DOUBLE PRECISION)) * SUM(CAST("t24"."cs_quantity" AS DOUBLE PRECISION)) / COUNT(CAST("t24"."cs_quantity" AS DOUBLE PRECISION))) / CASE WHEN COUNT(CAST("t24"."cs_quantity" AS DOUBLE PRECISION)) = 1 THEN NULL ELSE COUNT(CAST("t24"."cs_quantity" AS DOUBLE PRECISION)) - 1 END, 0.5) / (CAST(SUM("t24"."cs_quantity") AS DOUBLE PRECISION) / COUNT("t24"."cs_quantity")) AS "catalog_sales_quantitystdev", POWER((SUM(CAST("t24"."cs_quantity" AS DOUBLE PRECISION) * CAST("t24"."cs_quantity" AS DOUBLE PRECISION)) - SUM(CAST("t24"."cs_quantity" AS DOUBLE PRECISION)) * SUM(CAST("t24"."cs_quantity" AS DOUBLE PRECISION)) / COUNT(CAST("t24"."cs_quantity" AS DOUBLE PRECISION))) / CASE WHEN COUNT(CAST("t24"."cs_quantity" AS DOUBLE PRECISION)) = 1 THEN NULL ELSE COUNT(CAST("t24"."cs_quantity" AS DOUBLE PRECISION)) - 1 END, 0.5) / (CAST(SUM("t24"."cs_quantity") AS DOUBLE PRECISION) / COUNT("t24"."cs_quantity")) AS "catalog_sales_quantitycov" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ticket_number", "ss_quantity" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ticket_number", "ss_quantity" +FROM "store_sales") AS "t" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL AND "ss_ticket_number" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_quarter_name" +FROM "date_dim") AS "t2" +WHERE "d_quarter_name" = '2000Q1' AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "s_store_sk", "s_state" +FROM (SELECT "s_store_sk", "s_state" +FROM "store") AS "t5" +WHERE "s_store_sk" IS NOT NULL) AS "t7" ON "t1"."ss_store_sk" = "t7"."s_store_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id", "i_item_desc" +FROM (SELECT "i_item_sk", "i_item_id", "i_item_desc" +FROM "item") AS "t8" +WHERE "i_item_sk" IS NOT NULL) AS "t10" ON "t1"."ss_item_sk" = "t10"."i_item_sk" +INNER JOIN (SELECT "t13"."sr_returned_date_sk", "t13"."sr_item_sk", "t13"."sr_customer_sk", "t13"."sr_ticket_number", "t13"."sr_return_quantity", "t16"."d_date_sk", "t23"."cs_sold_date_sk", "t23"."cs_bill_customer_sk", "t23"."cs_item_sk", "t23"."cs_quantity", "t23"."d_date_sk" AS "d_date_sk0" +FROM (SELECT "sr_returned_date_sk", "sr_item_sk", "sr_customer_sk", "sr_ticket_number", "sr_return_quantity" +FROM (SELECT "sr_returned_date_sk", "sr_item_sk", "sr_customer_sk", "sr_ticket_number", "sr_return_quantity" +FROM "store_returns") AS "t11" +WHERE "sr_customer_sk" IS NOT NULL AND "sr_item_sk" IS NOT NULL AND "sr_ticket_number" IS NOT NULL AND "sr_returned_date_sk" IS NOT NULL) AS "t13" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_quarter_name" +FROM "date_dim") AS "t14" +WHERE "d_quarter_name" IN ('2000Q1', '2000Q2', '2000Q3') AND "d_date_sk" IS NOT NULL) AS "t16" ON "t13"."sr_returned_date_sk" = "t16"."d_date_sk" +INNER JOIN (SELECT "t19"."cs_sold_date_sk", "t19"."cs_bill_customer_sk", "t19"."cs_item_sk", "t19"."cs_quantity", "t22"."d_date_sk" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk", "cs_quantity" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk", "cs_quantity" +FROM "catalog_sales") AS "t17" +WHERE "cs_bill_customer_sk" IS NOT NULL AND "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t19" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_quarter_name" +FROM "date_dim") AS "t20" +WHERE "d_quarter_name" IN ('2000Q1', '2000Q2', '2000Q3') AND "d_date_sk" IS NOT NULL) AS "t22" ON "t19"."cs_sold_date_sk" = "t22"."d_date_sk") AS "t23" ON "t13"."sr_customer_sk" = "t23"."cs_bill_customer_sk" AND "t13"."sr_item_sk" = "t23"."cs_item_sk") AS "t24" ON "t1"."ss_customer_sk" = "t24"."sr_customer_sk" AND "t1"."ss_item_sk" = "t24"."sr_item_sk" AND "t1"."ss_ticket_number" = "t24"."sr_ticket_number" +GROUP BY "t10"."i_item_id", "t10"."i_item_desc", "t7"."s_state" +ORDER BY "t10"."i_item_id", "t10"."i_item_desc", "t7"."s_state" +FETCH NEXT 100 ROWS ONLY) AS "t28" + hive.sql.query.fieldNames i_item_id,i_item_desc,s_state,store_sales_quantitycount,store_sales_quantityave,store_sales_quantitystdev,store_sales_quantitycov,as_store_returns_quantitycount,as_store_returns_quantityave,as_store_returns_quantitystdev,store_returns_quantitycov,catalog_sales_quantitycount,catalog_sales_quantityave,catalog_sales_quantitystdev,catalog_sales_quantitycov + hive.sql.query.fieldTypes string,string,string,bigint,double,double,double,bigint,double,double,double,bigint,double,double,double + hive.sql.query.split false + Select Operator + expressions: i_item_id (type: string), i_item_desc (type: string), s_state (type: string), store_sales_quantitycount (type: bigint), store_sales_quantityave (type: double), store_sales_quantitystdev (type: double), store_sales_quantitycov (type: double), as_store_returns_quantitycount (type: bigint), as_store_returns_quantityave (type: double), as_store_returns_quantitystdev (type: double), store_returns_quantitycov (type: double), catalog_sales_quantitycount (type: bigint), catalog_sales_quantityave (type: double), catalog_sales_quantitystdev (type: double), catalog_sales_quantitycov (type: double) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query18.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query18.q.out new file mode 100644 index 000000000000..aef24dd8106f --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query18.q.out @@ -0,0 +1,123 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t1"."cs_sold_date_sk", "t1"."cs_bill_customer_sk", "t1"."cs_bill_cdemo_sk", "t1"."cs_item_sk", "t1"."$f4", "t1"."$f5", "t1"."$f6", "t1"."$f7", "t1"."$f8", "t4"."d_date_sk", "t7"."cd_demo_sk", "t7"."$f10", "t10"."i_item_sk", "t10"."i_item_id", "t20"."c_customer_sk", "t20"."c_current_cdemo_sk", "t20"."c_current_addr_sk", "t20"."$f9", "t20"."cd_demo_sk" AS "cd_demo_sk0", "t20"."ca_address_sk", "t20"."ca_county", "t20"."ca_state", "t20"."ca_country" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_bill_cdemo_sk", "cs_item_sk", CAST("cs_quantity" AS DECIMAL(12, 2)) AS "$f4", CAST("cs_list_price" AS DECIMAL(12, 2)) AS "$f5", CAST("cs_coupon_amt" AS DECIMAL(12, 2)) AS "$f6", CAST("cs_sales_price" AS DECIMAL(12, 2)) AS "$f7", CAST("cs_net_profit" AS DECIMAL(12, 2)) AS "$f8" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_bill_cdemo_sk", "cs_item_sk", "cs_quantity", "cs_list_price", "cs_sales_price", "cs_coupon_amt", "cs_net_profit" +FROM "catalog_sales") AS "t" +WHERE "cs_bill_cdemo_sk" IS NOT NULL AND "cs_bill_customer_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL AND "cs_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2001 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "cd_demo_sk", CAST("cd_dep_count" AS DECIMAL(12, 2)) AS "$f10" +FROM (SELECT "cd_demo_sk", "cd_gender", "cd_education_status", "cd_dep_count" +FROM "customer_demographics") AS "t5" +WHERE "cd_gender" = 'M' AND "cd_education_status" = 'College' AND "cd_demo_sk" IS NOT NULL) AS "t7" ON "t1"."cs_bill_cdemo_sk" = "t7"."cd_demo_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t8" +WHERE "i_item_sk" IS NOT NULL) AS "t10" ON "t1"."cs_item_sk" = "t10"."i_item_sk" +INNER JOIN (SELECT "t13"."c_customer_sk", "t13"."c_current_cdemo_sk", "t13"."c_current_addr_sk", "t13"."$f9", "t16"."cd_demo_sk", "t19"."ca_address_sk", "t19"."ca_county", "t19"."ca_state", "t19"."ca_country" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_addr_sk", CAST("c_birth_year" AS DECIMAL(12, 2)) AS "$f9" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_addr_sk", "c_birth_month", "c_birth_year" +FROM "customer") AS "t11" +WHERE "c_birth_month" IN (1, 4, 5, 9, 10, 12) AND "c_customer_sk" IS NOT NULL AND "c_current_cdemo_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL) AS "t13" +INNER JOIN (SELECT "cd_demo_sk" +FROM (SELECT "cd_demo_sk" +FROM "customer_demographics") AS "t14" +WHERE "cd_demo_sk" IS NOT NULL) AS "t16" ON "t13"."c_current_cdemo_sk" = "t16"."cd_demo_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_county", "ca_state", "ca_country" +FROM (SELECT "ca_address_sk", "ca_county", "ca_state", "ca_country" +FROM "customer_address") AS "t17" +WHERE "ca_state" IN ('AL', 'MS', 'NC', 'ND', 'OK', 'TN', 'WI') AND "ca_address_sk" IS NOT NULL) AS "t19" ON "t13"."c_current_addr_sk" = "t19"."ca_address_sk") AS "t20" ON "t1"."cs_bill_customer_sk" = "t20"."c_customer_sk" + hive.sql.query.fieldNames cs_sold_date_sk,cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,$f4,$f5,$f6,$f7,$f8,d_date_sk,cd_demo_sk,$f10,i_item_sk,i_item_id,c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,$f9,cd_demo_sk0,ca_address_sk,ca_county,ca_state,ca_country + hive.sql.query.fieldTypes int,int,int,bigint,decimal(12,2),decimal(12,2),decimal(12,2),decimal(12,2),decimal(12,2),int,int,decimal(12,2),bigint,string,int,int,int,decimal(12,2),int,int,string,string,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 1520 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f4 (type: decimal(12,2)), $f5 (type: decimal(12,2)), $f6 (type: decimal(12,2)), $f7 (type: decimal(12,2)), $f8 (type: decimal(12,2)), $f10 (type: decimal(12,2)), i_item_id (type: string), $f9 (type: decimal(12,2)), ca_county (type: string), ca_state (type: string), ca_country (type: string) + outputColumnNames: _col4, _col5, _col6, _col7, _col8, _col11, _col13, _col17, _col20, _col21, _col22 + Statistics: Num rows: 1 Data size: 1520 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col4), count(_col4), sum(_col5), count(_col5), sum(_col6), count(_col6), sum(_col7), count(_col7), sum(_col8), count(_col8), sum(_col17), count(_col17), sum(_col11), count(_col11) + keys: _col13 (type: string), _col20 (type: string), _col21 (type: string), _col22 (type: string), 0L (type: bigint) + grouping sets: 0, 4, 6, 7, 15 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18 + Statistics: Num rows: 5 Data size: 7600 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: bigint) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: bigint) + Statistics: Num rows: 5 Data size: 7600 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: decimal(22,2)), _col6 (type: bigint), _col7 (type: decimal(22,2)), _col8 (type: bigint), _col9 (type: decimal(22,2)), _col10 (type: bigint), _col11 (type: decimal(22,2)), _col12 (type: bigint), _col13 (type: decimal(22,2)), _col14 (type: bigint), _col15 (type: decimal(22,2)), _col16 (type: bigint), _col17 (type: decimal(22,2)), _col18 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), count(VALUE._col1), sum(VALUE._col2), count(VALUE._col3), sum(VALUE._col4), count(VALUE._col5), sum(VALUE._col6), count(VALUE._col7), sum(VALUE._col8), count(VALUE._col9), sum(VALUE._col10), count(VALUE._col11), sum(VALUE._col12), count(VALUE._col13) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string), KEY._col3 (type: string), KEY._col4 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18 + Statistics: Num rows: 2 Data size: 3040 Basic stats: COMPLETE Column stats: NONE + pruneGroupingSetId: true + Top N Key Operator + sort order: ++++ + keys: _col3 (type: string), _col2 (type: string), _col1 (type: string), _col0 (type: string) + null sort order: zzzz + Statistics: Num rows: 2 Data size: 3040 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col0 (type: string), _col3 (type: string), _col2 (type: string), _col1 (type: string), CAST( (_col5 / _col6) AS decimal(16,6)) (type: decimal(16,6)), CAST( (_col7 / _col8) AS decimal(16,6)) (type: decimal(16,6)), CAST( (_col9 / _col10) AS decimal(16,6)) (type: decimal(16,6)), CAST( (_col11 / _col12) AS decimal(16,6)) (type: decimal(16,6)), CAST( (_col13 / _col14) AS decimal(16,6)) (type: decimal(16,6)), CAST( (_col15 / _col16) AS decimal(16,6)) (type: decimal(16,6)), CAST( (_col17 / _col18) AS decimal(16,6)) (type: decimal(16,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 2 Data size: 3040 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: string), _col2 (type: string), _col3 (type: string), _col0 (type: string) + null sort order: zzzz + sort order: ++++ + Statistics: Num rows: 2 Data size: 3040 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: decimal(16,6)), _col5 (type: decimal(16,6)), _col6 (type: decimal(16,6)), _col7 (type: decimal(16,6)), _col8 (type: decimal(16,6)), _col9 (type: decimal(16,6)), _col10 (type: decimal(16,6)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey3 (type: string), KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), VALUE._col0 (type: decimal(16,6)), VALUE._col1 (type: decimal(16,6)), VALUE._col2 (type: decimal(16,6)), VALUE._col3 (type: decimal(16,6)), VALUE._col4 (type: decimal(16,6)), VALUE._col5 (type: decimal(16,6)), VALUE._col6 (type: decimal(16,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 2 Data size: 3040 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 2 Data size: 3040 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 2 Data size: 3040 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query19.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query19.q.out new file mode 100644 index 000000000000..a2e030600d6b --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query19.q.out @@ -0,0 +1,280 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE) + Reducer 3 <- Map 9 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Map 10 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Map 11 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) + Reducer 7 <- Reducer 6 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "c_customer_sk", "c_current_addr_sk" +FROM (SELECT "c_customer_sk", "c_current_addr_sk" +FROM "customer") AS "t" +WHERE "c_customer_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL + hive.sql.query.fieldNames c_customer_sk,c_current_addr_sk + hive.sql.query.fieldTypes int,int + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_customer_sk (type: int), c_current_addr_sk (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 10 + Map Operator Tree: + TableScan + alias: store + properties: + hive.sql.query SELECT "s_store_sk", "s_zip" +FROM (SELECT "s_store_sk", "s_zip" +FROM "store") AS "t" +WHERE "s_store_sk" IS NOT NULL + hive.sql.query.fieldNames s_store_sk,s_zip + hive.sql.query.fieldTypes int,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: s_store_sk (type: int), substr(s_zip, 1, 5) (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 11 + Map Operator Tree: + TableScan + alias: item + properties: + hive.sql.query SELECT "i_item_sk", "i_brand_id", "i_brand", "i_manufact_id", "i_manufact" +FROM (SELECT "i_item_sk", "i_brand_id", "i_brand", "i_manufact_id", "i_manufact", "i_manager_id" +FROM "item") AS "t" +WHERE "i_manager_id" = 7 AND "i_item_sk" IS NOT NULL + hive.sql.query.fieldNames i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact + hive.sql.query.fieldTypes bigint,int,string,int,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 384 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_sk (type: bigint), i_brand_id (type: int), i_brand (type: string), i_manufact_id (type: int), i_manufact (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 384 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 384 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col2 (type: string), _col3 (type: int), _col4 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 8 + Map Operator Tree: + TableScan + alias: customer_address + properties: + hive.sql.query SELECT "ca_address_sk", "ca_zip" +FROM (SELECT "ca_address_sk", "ca_zip" +FROM "customer_address") AS "t" +WHERE "ca_address_sk" IS NOT NULL + hive.sql.query.fieldNames ca_address_sk,ca_zip + hive.sql.query.fieldTypes int,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ca_address_sk (type: int), substr(ca_zip, 1, 5) (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_sold_date_sk", "t1"."ss_item_sk", "t1"."ss_customer_sk", "t1"."ss_store_sk", "t1"."ss_ext_sales_price", "t4"."d_date_sk" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_moy" = 11 AND "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price,d_date_sk + hive.sql.query.fieldTypes int,bigint,int,int,decimal(7,2),int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_item_sk (type: bigint), ss_customer_sk (type: int), ss_store_sk (type: int), ss_ext_sales_price (type: decimal(7,2)) + outputColumnNames: _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col2 (type: int) + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint), _col3 (type: int), _col4 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col1 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col0, _col3 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: string) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col2 (type: int) + outputColumnNames: _col3, _col5, _col7, _col8 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col7 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col7 (type: int) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: string), _col5 (type: bigint), _col8 (type: decimal(7,2)) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col7 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col3, _col5, _col8, _col11 + residual filter predicates: {(_col3 <> _col11)} + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col5 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col5 (type: bigint) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col8 (type: decimal(7,2)) + Reducer 5 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col5 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col8, _col13, _col14, _col15, _col16 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col8) + keys: _col14 (type: string), _col13 (type: int), _col15 (type: int), _col16 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: string) + null sort order: zzzz + sort order: ++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: string) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: decimal(17,2)) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string), KEY._col1 (type: int), KEY._col2 (type: int), KEY._col3 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: -++++ + keys: _col4 (type: decimal(17,2)), _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: string) + null sort order: azzzz + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col2 (type: int), _col3 (type: string), _col4 (type: decimal(17,2)), _col0 (type: string), _col1 (type: int) + outputColumnNames: _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col4 (type: decimal(17,2)), _col5 (type: string), _col6 (type: int), _col2 (type: int), _col3 (type: string) + null sort order: azzzz + sort order: -++++ + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reducer 7 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey2 (type: int), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey3 (type: int), KEY.reducesinkkey4 (type: string), KEY.reducesinkkey0 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query1b.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query1b.q.out new file mode 100644 index 000000000000..d283e5f0ed99 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query1b.q.out @@ -0,0 +1,55 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_returns + properties: + hive.sql.query SELECT "t25"."c_customer_id" +FROM (SELECT "t13"."c_customer_id" +FROM (SELECT "t1"."sr_customer_sk", "t1"."sr_store_sk", SUM("t1"."sr_fee") AS "$f2" +FROM (SELECT "sr_returned_date_sk", "sr_customer_sk", "sr_store_sk", "sr_fee" +FROM (SELECT "sr_returned_date_sk", "sr_customer_sk", "sr_store_sk", "sr_fee" +FROM "store_returns") AS "t" +WHERE "sr_returned_date_sk" IS NOT NULL AND "sr_store_sk" IS NOT NULL AND "sr_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."sr_returned_date_sk" = "t4"."d_date_sk" +GROUP BY "t1"."sr_customer_sk", "t1"."sr_store_sk" +HAVING SUM("t1"."sr_fee") IS NOT NULL) AS "t7" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_state" +FROM "store") AS "t8" +WHERE "s_state" = 'NM' AND "s_store_sk" IS NOT NULL) AS "t10" ON "t7"."sr_store_sk" = "t10"."s_store_sk" +INNER JOIN (SELECT "c_customer_sk", "c_customer_id" +FROM (SELECT "c_customer_sk", "c_customer_id" +FROM "customer") AS "t11" +WHERE "c_customer_sk" IS NOT NULL) AS "t13" ON "t7"."sr_customer_sk" = "t13"."c_customer_sk" +INNER JOIN (SELECT CAST(SUM("t20"."$f2") / COUNT("t20"."$f2") AS DECIMAL(19, 6)) * 1.2 AS "_o__c0", "t20"."sr_store_sk" AS "ctr_store_sk" +FROM (SELECT "t16"."sr_customer_sk", "t16"."sr_store_sk", SUM("t16"."sr_fee") AS "$f2" +FROM (SELECT "sr_returned_date_sk", "sr_customer_sk", "sr_store_sk", "sr_fee" +FROM (SELECT "sr_returned_date_sk", "sr_customer_sk", "sr_store_sk", "sr_fee" +FROM "store_returns") AS "t14" +WHERE "sr_returned_date_sk" IS NOT NULL AND "sr_store_sk" IS NOT NULL) AS "t16" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t17" +WHERE "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t19" ON "t16"."sr_returned_date_sk" = "t19"."d_date_sk" +GROUP BY "t16"."sr_customer_sk", "t16"."sr_store_sk") AS "t20" +GROUP BY "t20"."sr_store_sk" +HAVING CAST(SUM("t20"."$f2") / COUNT("t20"."$f2") AS DECIMAL(19, 6)) IS NOT NULL) AS "t23" ON "t7"."sr_store_sk" = "t23"."ctr_store_sk" AND "t7"."$f2" > "t23"."_o__c0" +ORDER BY "t13"."c_customer_id" +FETCH NEXT 100 ROWS ONLY) AS "t25" + hive.sql.query.fieldNames c_customer_id + hive.sql.query.fieldTypes string + hive.sql.query.split false + Select Operator + expressions: c_customer_id (type: string) + outputColumnNames: _col0 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query2.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query2.q.out new file mode 100644 index 000000000000..4ad10e24bdbe --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query2.q.out @@ -0,0 +1,96 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t11"."$f0", "t11"."$f1", "t11"."$f2", "t11"."$f3", "t11"."$f4", "t11"."$f5", "t11"."$f6", "t11"."$f7", "t14"."d_week_seq", "t31"."$f0" AS "$f00", "t31"."$f1" AS "$f10", "t31"."$f2" AS "$f20", "t31"."$f3" AS "$f30", "t31"."$f4" AS "$f40", "t31"."$f5" AS "$f50", "t31"."$f6" AS "$f60", "t31"."$f7" AS "$f70", "t31"."d_week_seq" AS "d_week_seq0" +FROM (SELECT "t9"."d_week_seq" AS "$f0", SUM(CASE WHEN "t9"."EXPR$0" THEN "t6"."ws_ext_sales_price" ELSE NULL END) AS "$f1", SUM(CASE WHEN "t9"."EXPR$1" THEN "t6"."ws_ext_sales_price" ELSE NULL END) AS "$f2", SUM(CASE WHEN "t9"."EXPR$2" THEN "t6"."ws_ext_sales_price" ELSE NULL END) AS "$f3", SUM(CASE WHEN "t9"."EXPR$3" THEN "t6"."ws_ext_sales_price" ELSE NULL END) AS "$f4", SUM(CASE WHEN "t9"."EXPR$4" THEN "t6"."ws_ext_sales_price" ELSE NULL END) AS "$f5", SUM(CASE WHEN "t9"."EXPR$5" THEN "t6"."ws_ext_sales_price" ELSE NULL END) AS "$f6", SUM(CASE WHEN "t9"."EXPR$6" THEN "t6"."ws_ext_sales_price" ELSE NULL END) AS "$f7" +FROM (SELECT "ws_sold_date_sk", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_ext_sales_price" +FROM "web_sales") AS "t" +WHERE "ws_sold_date_sk" IS NOT NULL +UNION ALL +SELECT "cs_sold_date_sk", "cs_ext_sales_price" +FROM (SELECT "cs_sold_date_sk", "cs_ext_sales_price" +FROM "catalog_sales") AS "t2" +WHERE "cs_sold_date_sk" IS NOT NULL) AS "t5") AS "t6" +INNER JOIN (SELECT "d_date_sk", "d_week_seq", "d_day_name" = 'Sunday' AS "EXPR$0", "d_day_name" = 'Monday' AS "EXPR$1", "d_day_name" = 'Tuesday' AS "EXPR$2", "d_day_name" = 'Wednesday' AS "EXPR$3", "d_day_name" = 'Thursday' AS "EXPR$4", "d_day_name" = 'Friday' AS "EXPR$5", "d_day_name" = 'Saturday' AS "EXPR$6" +FROM (SELECT "d_date_sk", "d_week_seq", "d_day_name" +FROM "date_dim") AS "t7" +WHERE "d_date_sk" IS NOT NULL AND "d_week_seq" IS NOT NULL) AS "t9" ON "t6"."ws_sold_date_sk" = "t9"."d_date_sk" +GROUP BY "t9"."d_week_seq") AS "t11" +INNER JOIN (SELECT "d_week_seq" +FROM (SELECT "d_week_seq", "d_year" +FROM "date_dim") AS "t12" +WHERE "d_year" = 2001 AND "d_week_seq" IS NOT NULL) AS "t14" ON "t11"."$f0" = "t14"."d_week_seq" +INNER JOIN (SELECT "t27"."$f0", "t27"."$f1", "t27"."$f2", "t27"."$f3", "t27"."$f4", "t27"."$f5", "t27"."$f6", "t27"."$f7", "t30"."d_week_seq" +FROM (SELECT "t25"."d_week_seq" AS "$f0", SUM(CASE WHEN "t25"."EXPR$0" THEN "t22"."ws_ext_sales_price" ELSE NULL END) AS "$f1", SUM(CASE WHEN "t25"."EXPR$1" THEN "t22"."ws_ext_sales_price" ELSE NULL END) AS "$f2", SUM(CASE WHEN "t25"."EXPR$2" THEN "t22"."ws_ext_sales_price" ELSE NULL END) AS "$f3", SUM(CASE WHEN "t25"."EXPR$3" THEN "t22"."ws_ext_sales_price" ELSE NULL END) AS "$f4", SUM(CASE WHEN "t25"."EXPR$4" THEN "t22"."ws_ext_sales_price" ELSE NULL END) AS "$f5", SUM(CASE WHEN "t25"."EXPR$5" THEN "t22"."ws_ext_sales_price" ELSE NULL END) AS "$f6", SUM(CASE WHEN "t25"."EXPR$6" THEN "t22"."ws_ext_sales_price" ELSE NULL END) AS "$f7" +FROM (SELECT "ws_sold_date_sk", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_ext_sales_price" +FROM "web_sales") AS "t15" +WHERE "ws_sold_date_sk" IS NOT NULL +UNION ALL +SELECT "cs_sold_date_sk", "cs_ext_sales_price" +FROM (SELECT "cs_sold_date_sk", "cs_ext_sales_price" +FROM "catalog_sales") AS "t18" +WHERE "cs_sold_date_sk" IS NOT NULL) AS "t21") AS "t22" +INNER JOIN (SELECT "d_date_sk", "d_week_seq", "d_day_name" = 'Sunday' AS "EXPR$0", "d_day_name" = 'Monday' AS "EXPR$1", "d_day_name" = 'Tuesday' AS "EXPR$2", "d_day_name" = 'Wednesday' AS "EXPR$3", "d_day_name" = 'Thursday' AS "EXPR$4", "d_day_name" = 'Friday' AS "EXPR$5", "d_day_name" = 'Saturday' AS "EXPR$6" +FROM (SELECT "d_date_sk", "d_week_seq", "d_day_name" +FROM "date_dim") AS "t23" +WHERE "d_date_sk" IS NOT NULL AND "d_week_seq" IS NOT NULL) AS "t25" ON "t22"."ws_sold_date_sk" = "t25"."d_date_sk" +GROUP BY "t25"."d_week_seq") AS "t27" +INNER JOIN (SELECT "d_week_seq" +FROM (SELECT "d_week_seq", "d_year" +FROM "date_dim") AS "t28" +WHERE "d_year" = 2002 AND "d_week_seq" IS NOT NULL) AS "t30" ON "t27"."$f0" = "t30"."d_week_seq") AS "t31" ON "t11"."$f0" = "t31"."$f0" - 53 + hive.sql.query.fieldNames $f0,$f1,$f2,$f3,$f4,$f5,$f6,$f7,d_week_seq,$f00,$f10,$f20,$f30,$f40,$f50,$f60,$f70,d_week_seq0 + hive.sql.query.fieldTypes int,decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),int,int,decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 1572 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: int), round(($f1 / $f10), 2) (type: decimal(20,2)), round(($f2 / $f20), 2) (type: decimal(20,2)), round(($f3 / $f30), 2) (type: decimal(20,2)), round(($f4 / $f40), 2) (type: decimal(20,2)), round(($f5 / $f50), 2) (type: decimal(20,2)), round(($f6 / $f60), 2) (type: decimal(20,2)), round(($f7 / $f70), 2) (type: decimal(20,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 1572 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Statistics: Num rows: 1 Data size: 1572 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(20,2)), _col2 (type: decimal(20,2)), _col3 (type: decimal(20,2)), _col4 (type: decimal(20,2)), _col5 (type: decimal(20,2)), _col6 (type: decimal(20,2)), _col7 (type: decimal(20,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: int), VALUE._col0 (type: decimal(20,2)), VALUE._col1 (type: decimal(20,2)), VALUE._col2 (type: decimal(20,2)), VALUE._col3 (type: decimal(20,2)), VALUE._col4 (type: decimal(20,2)), VALUE._col5 (type: decimal(20,2)), VALUE._col6 (type: decimal(20,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 1572 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 1572 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query20.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query20.q.out new file mode 100644 index 000000000000..f860cf5b1a78 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query20.q.out @@ -0,0 +1,116 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t7"."i_item_id", "t7"."i_item_desc", "t7"."i_current_price", "t7"."i_class", "t7"."i_category", SUM("t1"."cs_ext_sales_price") AS "$f5" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_ext_sales_price" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_ext_sales_price" +FROM "catalog_sales") AS "t" +WHERE "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t2" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '2001-01-12 00:00:00.000000000' AND TIMESTAMP '2001-02-11 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id", "i_item_desc", "i_current_price", "i_class", "i_category" +FROM (SELECT "i_item_sk", "i_item_id", "i_item_desc", "i_current_price", "i_class", "i_category" +FROM "item") AS "t5" +WHERE "i_category" IN ('Books', 'Jewelry', 'Sports') AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."cs_item_sk" = "t7"."i_item_sk" +GROUP BY "t7"."i_item_id", "t7"."i_item_desc", "t7"."i_current_price", "t7"."i_class", "t7"."i_category" + hive.sql.query.fieldNames i_item_id,i_item_desc,i_current_price,i_class,i_category,$f5 + hive.sql.query.fieldTypes string,string,decimal(7,2),string,string,decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_id (type: string), i_item_desc (type: string), i_current_price (type: decimal(7,2)), i_class (type: string), i_category (type: string), $f5 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: string) + null sort order: a + sort order: + + Map-reduce partition columns: _col3 (type: string) + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: decimal(7,2)), _col4 (type: string), _col5 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: string), VALUE._col1 (type: string), VALUE._col2 (type: decimal(7,2)), KEY.reducesinkkey0 (type: string), VALUE._col3 (type: string), VALUE._col4 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: string, _col2: decimal(7,2), _col3: string, _col4: string, _col5: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col3 ASC NULLS FIRST + partition by: _col3 + raw input shape: + window functions: + window function definition + alias: sum_window_0 + arguments: _col5 + name: sum + window function: GenericUDAFSumHiveDecimal + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +++++ + keys: _col4 (type: string), _col3 (type: string), _col0 (type: string), _col1 (type: string), ((_col5 * 100) / sum_window_0) (type: decimal(38,17)) + null sort order: zzzzz + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col1 (type: string), _col4 (type: string), _col3 (type: string), _col2 (type: decimal(7,2)), _col5 (type: decimal(17,2)), ((_col5 * 100) / sum_window_0) (type: decimal(38,17)), _col0 (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: string), _col2 (type: string), _col6 (type: string), _col0 (type: string), _col5 (type: decimal(38,17)) + null sort order: zzzzz + sort order: +++++ + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)), _col4 (type: decimal(17,2)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey3 (type: string), KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), VALUE._col0 (type: decimal(7,2)), VALUE._col1 (type: decimal(17,2)), KEY.reducesinkkey4 (type: decimal(38,17)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query21.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query21.q.out new file mode 100644 index 000000000000..16e8a9159af9 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query21.q.out @@ -0,0 +1,40 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: inventory + properties: + hive.sql.query SELECT "t13"."$f0", "t13"."$f1", "t13"."$f2", "t13"."$f3" +FROM (SELECT "t3"."w_warehouse_name" AS "$f0", "t6"."i_item_id" AS "$f1", SUM(CASE WHEN "t9"."EXPR$0" THEN "t0"."inv_quantity_on_hand" ELSE 0 END) AS "$f2", SUM(CASE WHEN "t9"."EXPR$1" THEN "t0"."inv_quantity_on_hand" ELSE 0 END) AS "$f3" +FROM (SELECT "inv_date_sk", "inv_item_sk", "inv_warehouse_sk", "inv_quantity_on_hand" +FROM "inventory" +WHERE "inv_warehouse_sk" IS NOT NULL AND "inv_item_sk" IS NOT NULL AND "inv_date_sk" IS NOT NULL) AS "t0" +INNER JOIN (SELECT "w_warehouse_sk", "w_warehouse_name" +FROM (SELECT "w_warehouse_sk", "w_warehouse_name" +FROM "warehouse") AS "t1" +WHERE "w_warehouse_sk" IS NOT NULL) AS "t3" ON "t0"."inv_warehouse_sk" = "t3"."w_warehouse_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id", "i_current_price" +FROM "item") AS "t4" +WHERE "i_current_price" BETWEEN 0.99 AND 1.49 AND "i_item_sk" IS NOT NULL) AS "t6" ON "t0"."inv_item_sk" = "t6"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_date" < DATE '1998-04-08' AS "EXPR$0", "d_date" >= DATE '1998-04-08' AS "EXPR$1" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t7" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '1998-03-09 00:00:00.000000000' AND TIMESTAMP '1998-05-08 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t9" ON "t0"."inv_date_sk" = "t9"."d_date_sk" +GROUP BY "t3"."w_warehouse_name", "t6"."i_item_id" +HAVING CASE WHEN SUM(CASE WHEN "t9"."EXPR$0" THEN "t0"."inv_quantity_on_hand" ELSE 0 END) > 0 THEN 0.666667 <= CAST(SUM(CASE WHEN "t9"."EXPR$1" THEN "t0"."inv_quantity_on_hand" ELSE 0 END) AS DOUBLE PRECISION) / CAST(SUM(CASE WHEN "t9"."EXPR$0" THEN "t0"."inv_quantity_on_hand" ELSE 0 END) AS DOUBLE PRECISION) ELSE FALSE END AND CASE WHEN SUM(CASE WHEN "t9"."EXPR$0" THEN "t0"."inv_quantity_on_hand" ELSE 0 END) > 0 THEN CAST(SUM(CASE WHEN "t9"."EXPR$1" THEN "t0"."inv_quantity_on_hand" ELSE 0 END) AS DOUBLE PRECISION) / CAST(SUM(CASE WHEN "t9"."EXPR$0" THEN "t0"."inv_quantity_on_hand" ELSE 0 END) AS DOUBLE PRECISION) <= 1.5 ELSE FALSE END +ORDER BY "t3"."w_warehouse_name", "t6"."i_item_id" +FETCH NEXT 100 ROWS ONLY) AS "t13" + hive.sql.query.fieldNames $f0,$f1,$f2,$f3 + hive.sql.query.fieldTypes string,string,bigint,bigint + hive.sql.query.split false + Select Operator + expressions: $f0 (type: string), $f1 (type: string), $f2 (type: bigint), $f3 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query22.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query22.q.out new file mode 100644 index 000000000000..b1e9e3d9033b --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query22.q.out @@ -0,0 +1,108 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: inventory + properties: + hive.sql.query SELECT "t0"."inv_date_sk", "t0"."inv_item_sk", "t0"."inv_warehouse_sk", "t0"."inv_quantity_on_hand", "t3"."d_date_sk", "t6"."w_warehouse_sk", "t9"."i_item_sk", "t9"."i_brand", "t9"."i_class", "t9"."i_category", "t9"."i_product_name" +FROM (SELECT "inv_date_sk", "inv_item_sk", "inv_warehouse_sk", "inv_quantity_on_hand" +FROM "inventory" +WHERE "inv_date_sk" IS NOT NULL AND "inv_item_sk" IS NOT NULL AND "inv_warehouse_sk" IS NOT NULL) AS "t0" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM "date_dim") AS "t1" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t3" ON "t0"."inv_date_sk" = "t3"."d_date_sk" +INNER JOIN (SELECT "w_warehouse_sk" +FROM (SELECT "w_warehouse_sk" +FROM "warehouse") AS "t4" +WHERE "w_warehouse_sk" IS NOT NULL) AS "t6" ON "t0"."inv_warehouse_sk" = "t6"."w_warehouse_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand", "i_class", "i_category", "i_product_name" +FROM (SELECT "i_item_sk", "i_brand", "i_class", "i_category", "i_product_name" +FROM "item") AS "t7" +WHERE "i_item_sk" IS NOT NULL) AS "t9" ON "t0"."inv_item_sk" = "t9"."i_item_sk" + hive.sql.query.fieldNames inv_date_sk,inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_date_sk,w_warehouse_sk,i_item_sk,i_brand,i_class,i_category,i_product_name + hive.sql.query.fieldTypes int,bigint,int,int,int,int,bigint,string,string,string,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 740 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: inv_quantity_on_hand (type: int), i_brand (type: string), i_class (type: string), i_category (type: string), i_product_name (type: string) + outputColumnNames: _col3, _col7, _col8, _col9, _col10 + Statistics: Num rows: 1 Data size: 740 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3), count(_col3) + keys: _col7 (type: string), _col8 (type: string), _col9 (type: string), _col10 (type: string), 0L (type: bigint) + grouping sets: 0, 2, 6, 14, 15 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 5 Data size: 3700 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: bigint) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: bigint) + Statistics: Num rows: 5 Data size: 3700 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: bigint), _col6 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), count(VALUE._col1) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string), KEY._col3 (type: string), KEY._col4 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col5, _col6 + Statistics: Num rows: 2 Data size: 1480 Basic stats: COMPLETE Column stats: NONE + pruneGroupingSetId: true + Top N Key Operator + sort order: +++++ + keys: (UDFToDouble(_col5) / _col6) (type: double), _col3 (type: string), _col0 (type: string), _col1 (type: string), _col2 (type: string) + null sort order: zzzzz + Statistics: Num rows: 2 Data size: 1480 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col3 (type: string), _col0 (type: string), _col1 (type: string), _col2 (type: string), (UDFToDouble(_col5) / _col6) (type: double) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 2 Data size: 1480 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col4 (type: double), _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string) + null sort order: zzzzz + sort order: +++++ + Statistics: Num rows: 2 Data size: 1480 Basic stats: COMPLETE Column stats: NONE + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), KEY.reducesinkkey3 (type: string), KEY.reducesinkkey4 (type: string), KEY.reducesinkkey0 (type: double) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 2 Data size: 1480 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 2 Data size: 1480 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 2 Data size: 1480 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query23.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query23.q.out new file mode 100644 index 000000000000..02e3ebf565df --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query23.q.out @@ -0,0 +1,373 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 10 <- Map 12 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE), Union 4 (CONTAINS) + Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE) + Reducer 3 <- Map 12 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE), Union 4 (CONTAINS) + Reducer 5 <- Union 4 (CUSTOM_SIMPLE_EDGE) + Reducer 7 <- Map 11 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE) + Reducer 8 <- Reducer 7 (SIMPLE_EDGE) + Reducer 9 <- Map 13 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t1"."cs_sold_date_sk", "t1"."cs_bill_customer_sk", "t1"."cs_item_sk", "t1"."cs_quantity", "t1"."cs_list_price", "t4"."d_date_sk", "t4"."d_year", "t4"."d_moy" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk", "cs_quantity", "cs_list_price" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk", "cs_quantity", "cs_list_price" +FROM "catalog_sales") AS "t" +WHERE "cs_item_sk" IS NOT NULL AND "cs_bill_customer_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 1999 AND "d_moy" = 1 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_sold_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,d_date_sk,d_year,d_moy + hive.sql.query.fieldTypes int,int,bigint,int,decimal(7,2),int,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_bill_customer_sk (type: int), cs_item_sk (type: bigint), cs_quantity (type: int), cs_list_price (type: decimal(7,2)) + outputColumnNames: _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col2 (type: bigint) + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col3 (type: int), _col4 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 11 + Map Operator Tree: + TableScan + alias: item + properties: + hive.sql.query SELECT "i_item_sk", "i_item_desc" +FROM (SELECT "i_item_sk", "i_item_desc" +FROM "item") AS "t" +WHERE "i_item_sk" IS NOT NULL + hive.sql.query.fieldNames i_item_sk,i_item_desc + hive.sql.query.fieldTypes bigint,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_sk (type: bigint), substr(i_item_desc, 1, 30) (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 12 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t7"."c_customer_sk" +FROM (SELECT "t4"."c_customer_sk", SUM("t1"."$f1") AS "$f1" +FROM (SELECT "ss_customer_sk", CAST("ss_quantity" AS DECIMAL(10, 0)) * "ss_sales_price" AS "$f1" +FROM (SELECT "ss_customer_sk", "ss_quantity", "ss_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "c_customer_sk" +FROM (SELECT "c_customer_sk" +FROM "customer") AS "t2" +WHERE "c_customer_sk" IS NOT NULL) AS "t4" ON "t1"."ss_customer_sk" = "t4"."c_customer_sk" +GROUP BY "t4"."c_customer_sk" +HAVING SUM("t1"."$f1") IS NOT NULL) AS "t7" +INNER JOIN (SELECT 0.95 * MAX("t17"."$f1") AS "EXPR$0" +FROM (SELECT "t13"."c_customer_sk", SUM("t10"."$f1") AS "$f1" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", CAST("ss_quantity" AS DECIMAL(10, 0)) * "ss_sales_price" AS "$f1" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_quantity", "ss_sales_price" +FROM "store_sales") AS "t8" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t10" +INNER JOIN (SELECT "c_customer_sk" +FROM (SELECT "c_customer_sk" +FROM "customer") AS "t11" +WHERE "c_customer_sk" IS NOT NULL) AS "t13" ON "t10"."ss_customer_sk" = "t13"."c_customer_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t14" +WHERE "d_year" IN (1999, 2000, 2001, 2002) AND "d_date_sk" IS NOT NULL) AS "t16" ON "t10"."ss_sold_date_sk" = "t16"."d_date_sk" +GROUP BY "t13"."c_customer_sk") AS "t17" +HAVING MAX("t17"."$f1") IS NOT NULL) AS "t20" ON "t7"."$f1" > "t20"."EXPR$0" + hive.sql.query.fieldNames c_customer_sk + hive.sql.query.fieldTypes int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_customer_sk (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 13 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t1"."ws_sold_date_sk", "t1"."ws_item_sk", "t1"."ws_bill_customer_sk", "t1"."ws_quantity", "t1"."ws_list_price", "t4"."d_date_sk", "t4"."d_year", "t4"."d_moy" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_customer_sk", "ws_quantity", "ws_list_price" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_customer_sk", "ws_quantity", "ws_list_price" +FROM "web_sales") AS "t" +WHERE "ws_item_sk" IS NOT NULL AND "ws_bill_customer_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 1999 AND "d_moy" = 1 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_sold_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames ws_sold_date_sk,ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price,d_date_sk,d_year,d_moy + hive.sql.query.fieldTypes int,bigint,int,int,decimal(7,2),int,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_item_sk (type: bigint), ws_bill_customer_sk (type: int), ws_quantity (type: int), ws_list_price (type: decimal(7,2)) + outputColumnNames: _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: bigint) + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: int), _col3 (type: int), _col4 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_sold_date_sk", "t1"."ss_item_sk", "t4"."d_date_sk", "t4"."d_date" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date", "d_year" +FROM "date_dim") AS "t2" +WHERE "d_year" IN (1999, 2000, 2001, 2002) AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames ss_sold_date_sk,ss_item_sk,d_date_sk,d_date + hive.sql.query.fieldTypes int,bigint,int,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_item_sk (type: bigint), d_date (type: string) + outputColumnNames: _col1, _col3 + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: bigint) + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 10 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col2 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col3, _col4 + Statistics: Num rows: 1 Data size: 154 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: (CAST( _col3 AS decimal(10,0)) * _col4) (type: decimal(18,2)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 154 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col0) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(28,2)) + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col2 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col1, _col3, _col4 + Statistics: Num rows: 1 Data size: 140 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 140 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: int), _col4 (type: decimal(7,2)) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col1 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col3, _col4 + Statistics: Num rows: 1 Data size: 154 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: (CAST( _col3 AS decimal(10,0)) * _col4) (type: decimal(18,2)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 154 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col0) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(28,2)) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + mode: mergepartial + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 7 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col1 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 211 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count() + keys: _col4 (type: bigint), _col3 (type: string), _col5 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 211 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: string) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: bigint), _col1 (type: string), _col2 (type: string) + Statistics: Num rows: 1 Data size: 211 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint) + Reducer 8 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + keys: KEY._col0 (type: bigint), KEY._col1 (type: string), KEY._col2 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 211 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: bigint), _col3 (type: bigint) + outputColumnNames: _col1, _col3 + Statistics: Num rows: 1 Data size: 211 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (_col3 > 4L) (type: boolean) + Statistics: Num rows: 1 Data size: 211 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col1 (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 211 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 211 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 211 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 211 Basic stats: COMPLETE Column stats: NONE + Reducer 9 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col1 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 140 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col2 (type: int) + Statistics: Num rows: 1 Data size: 140 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: int), _col4 (type: decimal(7,2)) + Union 4 + Vertex: Union 4 + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query24.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query24.q.out new file mode 100644 index 000000000000..2d6cf3c83a8a --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query24.q.out @@ -0,0 +1,402 @@ +Warning: Shuffle Join MERGEJOIN[111][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 5' is a cross product +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 10 <- Reducer 9 (SIMPLE_EDGE) + Reducer 11 <- Reducer 10 (CUSTOM_SIMPLE_EDGE) + Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE) + Reducer 3 <- Map 14 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 11 (XPROD_EDGE), Reducer 4 (XPROD_EDGE) + Reducer 7 <- Map 12 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE) + Reducer 8 <- Map 13 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE) + Reducer 9 <- Map 14 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_item_sk", "t1"."ss_customer_sk", "t1"."ss_store_sk", "t1"."ss_ticket_number", "t1"."ss_sales_price", "t4"."sr_item_sk", "t4"."sr_ticket_number", "t7"."i_item_sk", "t7"."i_current_price", "t7"."i_size", "t7"."i_units", "t7"."i_manager_id" +FROM (SELECT "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ticket_number", "ss_sales_price" +FROM (SELECT "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ticket_number", "ss_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_ticket_number" IS NOT NULL AND "ss_item_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "sr_item_sk", "sr_ticket_number" +FROM (SELECT "sr_item_sk", "sr_ticket_number" +FROM "store_returns") AS "t2" +WHERE "sr_ticket_number" IS NOT NULL AND "sr_item_sk" IS NOT NULL) AS "t4" ON "t1"."ss_ticket_number" = "t4"."sr_ticket_number" AND "t1"."ss_item_sk" = "t4"."sr_item_sk" +INNER JOIN (SELECT "i_item_sk", "i_current_price", "i_size", "i_units", "i_manager_id" +FROM (SELECT "i_item_sk", "i_current_price", "i_size", "i_color", "i_units", "i_manager_id" +FROM "item") AS "t5" +WHERE "i_color" = 'orchid' AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" + hive.sql.query.fieldNames ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_sales_price,sr_item_sk,sr_ticket_number,i_item_sk,i_current_price,i_size,i_units,i_manager_id + hive.sql.query.fieldTypes bigint,int,int,bigint,decimal(7,2),bigint,bigint,bigint,decimal(7,2),string,string,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 604 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_customer_sk (type: int), ss_store_sk (type: int), ss_sales_price (type: decimal(7,2)), i_current_price (type: decimal(7,2)), i_size (type: string), i_units (type: string), i_manager_id (type: int) + outputColumnNames: _col1, _col2, _col4, _col8, _col9, _col10, _col11 + Statistics: Num rows: 1 Data size: 604 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col2 (type: int) + Statistics: Num rows: 1 Data size: 604 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col4 (type: decimal(7,2)), _col8 (type: decimal(7,2)), _col9 (type: string), _col10 (type: string), _col11 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 12 + Map Operator Tree: + TableScan + alias: store + properties: + hive.sql.query SELECT "s_store_sk", "s_store_name", "s_state", "s_zip" +FROM (SELECT "s_store_sk", "s_store_name", "s_market_id", "s_state", "s_zip" +FROM "store") AS "t" +WHERE "s_market_id" = 7 AND "s_store_sk" IS NOT NULL AND "s_zip" IS NOT NULL + hive.sql.query.fieldNames s_store_sk,s_store_name,s_state,s_zip + hive.sql.query.fieldTypes int,string,string,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 556 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: s_store_sk (type: int), s_store_name (type: string), s_state (type: string), s_zip (type: string) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 556 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col3 (type: string) + Statistics: Num rows: 1 Data size: 556 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col1 (type: string), _col2 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 13 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_item_sk", "t1"."ss_customer_sk", "t1"."ss_store_sk", "t1"."ss_ticket_number", "t1"."ss_sales_price", "t4"."sr_item_sk", "t4"."sr_ticket_number", "t7"."i_item_sk", "t7"."i_current_price", "t7"."i_size", "t7"."i_color", "t7"."i_units", "t7"."i_manager_id" +FROM (SELECT "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ticket_number", "ss_sales_price" +FROM (SELECT "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ticket_number", "ss_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_ticket_number" IS NOT NULL AND "ss_item_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "sr_item_sk", "sr_ticket_number" +FROM (SELECT "sr_item_sk", "sr_ticket_number" +FROM "store_returns") AS "t2" +WHERE "sr_ticket_number" IS NOT NULL AND "sr_item_sk" IS NOT NULL) AS "t4" ON "t1"."ss_ticket_number" = "t4"."sr_ticket_number" AND "t1"."ss_item_sk" = "t4"."sr_item_sk" +INNER JOIN (SELECT "i_item_sk", "i_current_price", "i_size", "i_color", "i_units", "i_manager_id" +FROM (SELECT "i_item_sk", "i_current_price", "i_size", "i_color", "i_units", "i_manager_id" +FROM "item") AS "t5" +WHERE "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" + hive.sql.query.fieldNames ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_sales_price,sr_item_sk,sr_ticket_number,i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id + hive.sql.query.fieldTypes bigint,int,int,bigint,decimal(7,2),bigint,bigint,bigint,decimal(7,2),string,string,string,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 788 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_customer_sk (type: int), ss_store_sk (type: int), ss_sales_price (type: decimal(7,2)), i_current_price (type: decimal(7,2)), i_size (type: string), i_color (type: string), i_units (type: string), i_manager_id (type: int) + outputColumnNames: _col1, _col2, _col4, _col8, _col9, _col10, _col11, _col12 + Statistics: Num rows: 1 Data size: 788 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col2 (type: int) + Statistics: Num rows: 1 Data size: 788 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col4 (type: decimal(7,2)), _col8 (type: decimal(7,2)), _col9 (type: string), _col10 (type: string), _col11 (type: string), _col12 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 14 + Map Operator Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "c_customer_sk", "c_current_addr_sk", "c_first_name", "c_last_name", "c_birth_country" +FROM (SELECT "c_customer_sk", "c_current_addr_sk", "c_first_name", "c_last_name", "c_birth_country" +FROM "customer") AS "t" +WHERE "c_customer_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL + hive.sql.query.fieldNames c_customer_sk,c_current_addr_sk,c_first_name,c_last_name,c_birth_country + hive.sql.query.fieldTypes int,int,string,string,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_customer_sk (type: int), c_current_addr_sk (type: int), c_first_name (type: string), c_last_name (type: string), c_birth_country (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: int) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: int) + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: string), _col3 (type: string), _col4 (type: string) + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: int) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: int) + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: string), _col3 (type: string), _col4 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: customer_address + properties: + hive.sql.query SELECT "ca_address_sk", "ca_state", "ca_zip", "ca_country" +FROM (SELECT "ca_address_sk", "ca_state", "ca_zip", "ca_country" +FROM "customer_address") AS "t" +WHERE "ca_address_sk" IS NOT NULL AND "ca_zip" IS NOT NULL + hive.sql.query.fieldNames ca_address_sk,ca_state,ca_zip,ca_country + hive.sql.query.fieldTypes int,string,string,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 556 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ca_address_sk (type: int), ca_state (type: string), ca_zip (type: string), upper(ca_country) (type: string) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 556 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col2 (type: string) + Statistics: Num rows: 1 Data size: 556 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col1 (type: string), _col3 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 10 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: decimal(7,2)), KEY._col1 (type: string), KEY._col2 (type: string), KEY._col3 (type: string), KEY._col4 (type: int), KEY._col5 (type: string), KEY._col6 (type: string), KEY._col7 (type: string), KEY._col8 (type: string), KEY._col9 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col10 (type: decimal(17,2)) + outputColumnNames: _col10 + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col10), count(_col10) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(27,2)), _col1 (type: bigint) + Reducer 11 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), count(VALUE._col1) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: CAST( (_col0 / _col1) AS decimal(21,6)) is not null (type: boolean) + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: (0.05 * CAST( (_col0 / _col1) AS decimal(21,6))) (type: decimal(24,8)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(24,8)) + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col4 (type: int) + 1 _col2 (type: int) + outputColumnNames: _col0, _col1, _col3, _col5, _col6, _col9, _col12, _col16, _col17, _col18, _col19 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col9 (type: int), _col0 (type: int) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col9 (type: int), _col0 (type: int) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string), _col3 (type: string), _col5 (type: string), _col6 (type: string), _col12 (type: decimal(7,2)), _col16 (type: decimal(7,2)), _col17 (type: string), _col18 (type: string), _col19 (type: int) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col9 (type: int), _col0 (type: int) + 1 _col0 (type: int), _col1 (type: int) + outputColumnNames: _col1, _col3, _col5, _col6, _col12, _col16, _col17, _col18, _col19, _col22, _col23, _col24 + residual filter predicates: {(_col24 <> _col3)} + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col1 (type: string), _col5 (type: string), _col6 (type: string), _col12 (type: decimal(7,2)), _col16 (type: decimal(7,2)), _col17 (type: string), _col18 (type: string), _col19 (type: int), _col22 (type: string), _col23 (type: string) + outputColumnNames: _col1, _col5, _col6, _col12, _col16, _col17, _col18, _col19, _col22, _col23 + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col12) + keys: _col5 (type: string), _col22 (type: string), _col23 (type: string), _col16 (type: decimal(7,2)), _col17 (type: string), _col18 (type: string), _col19 (type: int), _col1 (type: string), _col6 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: decimal(7,2)), _col4 (type: string), _col5 (type: string), _col6 (type: int), _col7 (type: string), _col8 (type: string) + null sort order: zzzzzzzzz + sort order: +++++++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string) + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + value expressions: _col9 (type: decimal(17,2)) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string), KEY._col3 (type: decimal(7,2)), KEY._col4 (type: string), KEY._col5 (type: string), KEY._col6 (type: int), KEY._col7 (type: string), KEY._col8 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col9 (type: decimal(17,2)) + outputColumnNames: _col5, _col7, _col8, _col9 + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col9) + keys: _col5 (type: string), _col7 (type: string), _col8 (type: string) + mode: complete + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col2 (type: string), _col1 (type: string), _col0 (type: string), _col3 (type: decimal(27,2)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: _col3 is not null (type: boolean) + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: decimal(27,2)) + Reducer 5 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + residual filter predicates: {(_col3 > _col4)} + Statistics: Num rows: 1 Data size: 972 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: decimal(27,2)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 972 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 972 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 7 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col2 (type: string) + 1 _col3 (type: string) + outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 611 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col4 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col4 (type: int) + Statistics: Num rows: 1 Data size: 611 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col1 (type: string), _col3 (type: string), _col5 (type: string), _col6 (type: string) + Reduce Output Operator + key expressions: _col4 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col4 (type: int) + Statistics: Num rows: 1 Data size: 611 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col1 (type: string), _col3 (type: string), _col5 (type: string), _col6 (type: string) + Reducer 8 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col4 (type: int) + 1 _col2 (type: int) + outputColumnNames: _col0, _col1, _col3, _col5, _col6, _col9, _col12, _col16, _col17, _col18, _col19, _col20 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col9 (type: int), _col0 (type: int) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col9 (type: int), _col0 (type: int) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string), _col3 (type: string), _col5 (type: string), _col6 (type: string), _col12 (type: decimal(7,2)), _col16 (type: decimal(7,2)), _col17 (type: string), _col18 (type: string), _col19 (type: string), _col20 (type: int) + Reducer 9 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col9 (type: int), _col0 (type: int) + 1 _col0 (type: int), _col1 (type: int) + outputColumnNames: _col1, _col3, _col5, _col6, _col12, _col16, _col17, _col18, _col19, _col20, _col23, _col24, _col25 + residual filter predicates: {(_col25 <> _col3)} + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col1 (type: string), _col5 (type: string), _col6 (type: string), _col12 (type: decimal(7,2)), _col16 (type: decimal(7,2)), _col17 (type: string), _col18 (type: string), _col19 (type: string), _col20 (type: int), _col23 (type: string), _col24 (type: string) + outputColumnNames: _col1, _col5, _col6, _col12, _col16, _col17, _col18, _col19, _col20, _col23, _col24 + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col12) + keys: _col16 (type: decimal(7,2)), _col17 (type: string), _col18 (type: string), _col19 (type: string), _col20 (type: int), _col1 (type: string), _col5 (type: string), _col6 (type: string), _col23 (type: string), _col24 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: decimal(7,2)), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: int), _col5 (type: string), _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: string) + null sort order: zzzzzzzzzz + sort order: ++++++++++ + Map-reduce partition columns: _col0 (type: decimal(7,2)), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: int), _col5 (type: string), _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: string) + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + value expressions: _col10 (type: decimal(17,2)) + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query25.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query25.q.out new file mode 100644 index 000000000000..fe28b592e31f --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query25.q.out @@ -0,0 +1,58 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t27"."i_item_id", "t27"."i_item_desc", "t27"."s_store_id", "t27"."s_store_name", "t27"."$f4", "t27"."$f5", "t27"."$f6" +FROM (SELECT "t10"."i_item_id", "t10"."i_item_desc", "t7"."s_store_id", "t7"."s_store_name", SUM("t1"."ss_net_profit") AS "$f4", SUM("t24"."sr_net_loss") AS "$f5", SUM("t24"."cs_net_profit") AS "$f6" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ticket_number", "ss_net_profit" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ticket_number", "ss_net_profit" +FROM "store_sales") AS "t" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL AND "ss_ticket_number" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_moy" = 4 AND "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "s_store_sk", "s_store_id", "s_store_name" +FROM (SELECT "s_store_sk", "s_store_id", "s_store_name" +FROM "store") AS "t5" +WHERE "s_store_sk" IS NOT NULL) AS "t7" ON "t1"."ss_store_sk" = "t7"."s_store_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id", "i_item_desc" +FROM (SELECT "i_item_sk", "i_item_id", "i_item_desc" +FROM "item") AS "t8" +WHERE "i_item_sk" IS NOT NULL) AS "t10" ON "t1"."ss_item_sk" = "t10"."i_item_sk" +INNER JOIN (SELECT "t13"."sr_returned_date_sk", "t13"."sr_item_sk", "t13"."sr_customer_sk", "t13"."sr_ticket_number", "t13"."sr_net_loss", "t16"."d_date_sk", "t23"."cs_sold_date_sk", "t23"."cs_bill_customer_sk", "t23"."cs_item_sk", "t23"."cs_net_profit", "t23"."d_date_sk" AS "d_date_sk0" +FROM (SELECT "sr_returned_date_sk", "sr_item_sk", "sr_customer_sk", "sr_ticket_number", "sr_net_loss" +FROM (SELECT "sr_returned_date_sk", "sr_item_sk", "sr_customer_sk", "sr_ticket_number", "sr_net_loss" +FROM "store_returns") AS "t11" +WHERE "sr_customer_sk" IS NOT NULL AND "sr_item_sk" IS NOT NULL AND "sr_ticket_number" IS NOT NULL AND "sr_returned_date_sk" IS NOT NULL) AS "t13" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t14" +WHERE "d_moy" BETWEEN 4 AND 10 AND "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t16" ON "t13"."sr_returned_date_sk" = "t16"."d_date_sk" +INNER JOIN (SELECT "t19"."cs_sold_date_sk", "t19"."cs_bill_customer_sk", "t19"."cs_item_sk", "t19"."cs_net_profit", "t22"."d_date_sk" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk", "cs_net_profit" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk", "cs_net_profit" +FROM "catalog_sales") AS "t17" +WHERE "cs_bill_customer_sk" IS NOT NULL AND "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t19" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t20" +WHERE "d_moy" BETWEEN 4 AND 10 AND "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t22" ON "t19"."cs_sold_date_sk" = "t22"."d_date_sk") AS "t23" ON "t13"."sr_customer_sk" = "t23"."cs_bill_customer_sk" AND "t13"."sr_item_sk" = "t23"."cs_item_sk") AS "t24" ON "t1"."ss_customer_sk" = "t24"."sr_customer_sk" AND "t1"."ss_item_sk" = "t24"."sr_item_sk" AND "t1"."ss_ticket_number" = "t24"."sr_ticket_number" +GROUP BY "t7"."s_store_id", "t7"."s_store_name", "t10"."i_item_id", "t10"."i_item_desc" +ORDER BY "t10"."i_item_id", "t10"."i_item_desc", "t7"."s_store_id", "t7"."s_store_name" +FETCH NEXT 100 ROWS ONLY) AS "t27" + hive.sql.query.fieldNames i_item_id,i_item_desc,s_store_id,s_store_name,$f4,$f5,$f6 + hive.sql.query.fieldTypes string,string,string,string,decimal(17,2),decimal(17,2),decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: i_item_id (type: string), i_item_desc (type: string), s_store_id (type: string), s_store_name (type: string), $f4 (type: decimal(17,2)), $f5 (type: decimal(17,2)), $f6 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query26.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query26.q.out new file mode 100644 index 000000000000..0c7f27b1a891 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query26.q.out @@ -0,0 +1,44 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t16"."i_item_id", "t16"."agg1", "t16"."agg2", "t16"."agg3", "t16"."agg4" +FROM (SELECT "t13"."i_item_id", CAST(SUM("t1"."cs_quantity") AS DOUBLE PRECISION) / COUNT("t1"."cs_quantity") AS "agg1", CAST(SUM("t1"."cs_list_price") / COUNT("t1"."cs_list_price") AS DECIMAL(11, 6)) AS "agg2", CAST(SUM("t1"."cs_coupon_amt") / COUNT("t1"."cs_coupon_amt") AS DECIMAL(11, 6)) AS "agg3", CAST(SUM("t1"."cs_sales_price") / COUNT("t1"."cs_sales_price") AS DECIMAL(11, 6)) AS "agg4" +FROM (SELECT "cs_sold_date_sk", "cs_bill_cdemo_sk", "cs_item_sk", "cs_promo_sk", "cs_quantity", "cs_list_price", "cs_sales_price", "cs_coupon_amt" +FROM (SELECT "cs_sold_date_sk", "cs_bill_cdemo_sk", "cs_item_sk", "cs_promo_sk", "cs_quantity", "cs_list_price", "cs_sales_price", "cs_coupon_amt" +FROM "catalog_sales") AS "t" +WHERE "cs_bill_cdemo_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL AND "cs_item_sk" IS NOT NULL AND "cs_promo_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "cd_demo_sk" +FROM (SELECT "cd_demo_sk", "cd_gender", "cd_marital_status", "cd_education_status" +FROM "customer_demographics") AS "t2" +WHERE "cd_gender" = 'F' AND "cd_marital_status" = 'W' AND "cd_education_status" = 'Primary' AND "cd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."cs_bill_cdemo_sk" = "t4"."cd_demo_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t5" +WHERE "d_year" = 1998 AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."cs_sold_date_sk" = "t7"."d_date_sk" +INNER JOIN (SELECT "p_promo_sk" +FROM (SELECT "p_promo_sk", "p_channel_email", "p_channel_event" +FROM "promotion") AS "t8" +WHERE ("p_channel_email" = 'N' OR "p_channel_event" = 'N') AND "p_promo_sk" IS NOT NULL) AS "t10" ON "t1"."cs_promo_sk" = "t10"."p_promo_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t11" +WHERE "i_item_sk" IS NOT NULL) AS "t13" ON "t1"."cs_item_sk" = "t13"."i_item_sk" +GROUP BY "t13"."i_item_id" +ORDER BY "t13"."i_item_id" +FETCH NEXT 100 ROWS ONLY) AS "t16" + hive.sql.query.fieldNames i_item_id,agg1,agg2,agg3,agg4 + hive.sql.query.fieldTypes string,double,decimal(11,6),decimal(11,6),decimal(11,6) + hive.sql.query.split false + Select Operator + expressions: i_item_id (type: string), agg1 (type: double), agg2 (type: decimal(11,6)), agg3 (type: decimal(11,6)), agg4 (type: decimal(11,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query27.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query27.q.out new file mode 100644 index 000000000000..ecbd0bd2aa86 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query27.q.out @@ -0,0 +1,113 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t13"."i_item_id" AS "$f0", "t10"."s_state" AS "$f1", "t1"."ss_quantity" AS "$f2", "t1"."ss_list_price" AS "$f3", "t1"."ss_coupon_amt" AS "$f4", "t1"."ss_sales_price" AS "$f5" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_cdemo_sk", "ss_store_sk", "ss_quantity", "ss_list_price", "ss_sales_price", "ss_coupon_amt" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_cdemo_sk", "ss_store_sk", "ss_quantity", "ss_list_price", "ss_sales_price", "ss_coupon_amt" +FROM "store_sales") AS "t" +WHERE "ss_cdemo_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "cd_demo_sk" +FROM (SELECT "cd_demo_sk", "cd_gender", "cd_marital_status", "cd_education_status" +FROM "customer_demographics") AS "t2" +WHERE "cd_gender" = 'M' AND "cd_marital_status" = 'U' AND "cd_education_status" = '2 yr Degree' AND "cd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ss_cdemo_sk" = "t4"."cd_demo_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t5" +WHERE "d_year" = 2001 AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_date_sk" = "t7"."d_date_sk" +INNER JOIN (SELECT "s_store_sk", "s_state" +FROM (SELECT "s_store_sk", "s_state" +FROM "store") AS "t8" +WHERE "s_state" IN ('FL', 'LA', 'MI', 'MO', 'SC', 'SD') AND "s_store_sk" IS NOT NULL) AS "t10" ON "t1"."ss_store_sk" = "t10"."s_store_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t11" +WHERE "i_item_sk" IS NOT NULL) AS "t13" ON "t1"."ss_item_sk" = "t13"."i_item_sk" + hive.sql.query.fieldNames $f0,$f1,$f2,$f3,$f4,$f5 + hive.sql.query.fieldTypes string,string,int,decimal(7,2),decimal(7,2),decimal(7,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 708 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: $f0 (type: string), $f1 (type: string) + null sort order: zz + Statistics: Num rows: 1 Data size: 708 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: $f0 (type: string), $f1 (type: string), $f2 (type: int), $f3 (type: decimal(7,2)), $f4 (type: decimal(7,2)), $f5 (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 708 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col2), count(_col2), sum(_col3), count(_col3), sum(_col4), count(_col4), sum(_col5), count(_col5) + keys: _col0 (type: string), _col1 (type: string), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 3 Data size: 2124 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + Statistics: Num rows: 3 Data size: 2124 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint), _col4 (type: bigint), _col5 (type: decimal(17,2)), _col6 (type: bigint), _col7 (type: decimal(17,2)), _col8 (type: bigint), _col9 (type: decimal(17,2)), _col10 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), count(VALUE._col1), sum(VALUE._col2), count(VALUE._col3), sum(VALUE._col4), count(VALUE._col5), sum(VALUE._col6), count(VALUE._col7) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 1 Data size: 708 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: string), grouping(_col2, 0L) (type: bigint), (UDFToDouble(_col3) / _col4) (type: double), CAST( (_col5 / _col6) AS decimal(11,6)) (type: decimal(11,6)), CAST( (_col7 / _col8) AS decimal(11,6)) (type: decimal(11,6)), CAST( (_col9 / _col10) AS decimal(11,6)) (type: decimal(11,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 708 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string) + null sort order: zz + sort order: ++ + Statistics: Num rows: 1 Data size: 708 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: bigint), _col3 (type: double), _col4 (type: decimal(11,6)), _col5 (type: decimal(11,6)), _col6 (type: decimal(11,6)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), VALUE._col0 (type: bigint), VALUE._col1 (type: double), VALUE._col2 (type: decimal(11,6)), VALUE._col3 (type: decimal(11,6)), VALUE._col4 (type: decimal(11,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 708 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 708 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 708 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query28.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query28.q.out new file mode 100644 index 000000000000..d78b69bb1ba4 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query28.q.out @@ -0,0 +1,258 @@ +Warning: Shuffle Join MERGEJOIN[29][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product +Warning: Shuffle Join MERGEJOIN[30][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Reducer 3' is a cross product +Warning: Shuffle Join MERGEJOIN[31][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3]] in Stage 'Reducer 4' is a cross product +Warning: Shuffle Join MERGEJOIN[32][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4]] in Stage 'Reducer 5' is a cross product +Warning: Shuffle Join MERGEJOIN[33][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5]] in Stage 'Reducer 6' is a cross product +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (XPROD_EDGE), Map 7 (XPROD_EDGE) + Reducer 3 <- Map 8 (XPROD_EDGE), Reducer 2 (XPROD_EDGE) + Reducer 4 <- Map 9 (XPROD_EDGE), Reducer 3 (XPROD_EDGE) + Reducer 5 <- Map 10 (XPROD_EDGE), Reducer 4 (XPROD_EDGE) + Reducer 6 <- Map 11 (XPROD_EDGE), Reducer 5 (XPROD_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_list_price") / COUNT("ss_list_price") AS DECIMAL(11, 6)) AS "b1_lp", COUNT("ss_list_price") AS "b1_cnt", COUNT(DISTINCT "ss_list_price") AS "b1_cntd" +FROM (SELECT "ss_quantity", "ss_wholesale_cost", "ss_list_price", "ss_coupon_amt" +FROM "store_sales") AS "t" +WHERE ("ss_list_price" BETWEEN 11 AND 21 OR "ss_coupon_amt" BETWEEN 460 AND 1460 OR "ss_wholesale_cost" BETWEEN 14 AND 34) AND "ss_quantity" BETWEEN 0 AND 5 + hive.sql.query.fieldNames b1_lp,b1_cnt,b1_cntd + hive.sql.query.fieldTypes decimal(11,6),bigint,bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: b1_lp (type: decimal(11,6)), b1_cnt (type: bigint), b1_cntd (type: bigint) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)), _col1 (type: bigint), _col2 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 10 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_list_price") / COUNT("ss_list_price") AS DECIMAL(11, 6)) AS "b3_lp", COUNT("ss_list_price") AS "b3_cnt", COUNT(DISTINCT "ss_list_price") AS "b3_cntd" +FROM (SELECT "ss_quantity", "ss_wholesale_cost", "ss_list_price", "ss_coupon_amt" +FROM "store_sales") AS "t" +WHERE ("ss_list_price" BETWEEN 66 AND 76 OR "ss_coupon_amt" BETWEEN 920 AND 1920 OR "ss_wholesale_cost" BETWEEN 4 AND 24) AND "ss_quantity" BETWEEN 11 AND 15 + hive.sql.query.fieldNames b3_lp,b3_cnt,b3_cntd + hive.sql.query.fieldTypes decimal(11,6),bigint,bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: b3_lp (type: decimal(11,6)), b3_cnt (type: bigint), b3_cntd (type: bigint) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)), _col1 (type: bigint), _col2 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 11 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_list_price") / COUNT("ss_list_price") AS DECIMAL(11, 6)) AS "b2_lp", COUNT("ss_list_price") AS "b2_cnt", COUNT(DISTINCT "ss_list_price") AS "b2_cntd" +FROM (SELECT "ss_quantity", "ss_wholesale_cost", "ss_list_price", "ss_coupon_amt" +FROM "store_sales") AS "t" +WHERE ("ss_list_price" BETWEEN 91 AND 101 OR "ss_coupon_amt" BETWEEN 1430 AND 2430 OR "ss_wholesale_cost" BETWEEN 32 AND 52) AND "ss_quantity" BETWEEN 6 AND 10 + hive.sql.query.fieldNames b2_lp,b2_cnt,b2_cntd + hive.sql.query.fieldTypes decimal(11,6),bigint,bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: b2_lp (type: decimal(11,6)), b2_cnt (type: bigint), b2_cntd (type: bigint) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)), _col1 (type: bigint), _col2 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_list_price") / COUNT("ss_list_price") AS DECIMAL(11, 6)) AS "b6_lp", COUNT("ss_list_price") AS "b6_cnt", COUNT(DISTINCT "ss_list_price") AS "b6_cntd" +FROM (SELECT "ss_quantity", "ss_wholesale_cost", "ss_list_price", "ss_coupon_amt" +FROM "store_sales") AS "t" +WHERE ("ss_list_price" BETWEEN 28 AND 38 OR "ss_coupon_amt" BETWEEN 2513 AND 3513 OR "ss_wholesale_cost" BETWEEN 42 AND 62) AND "ss_quantity" BETWEEN 26 AND 30 + hive.sql.query.fieldNames b6_lp,b6_cnt,b6_cntd + hive.sql.query.fieldTypes decimal(11,6),bigint,bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: b6_lp (type: decimal(11,6)), b6_cnt (type: bigint), b6_cntd (type: bigint) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)), _col1 (type: bigint), _col2 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 8 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_list_price") / COUNT("ss_list_price") AS DECIMAL(11, 6)) AS "b5_lp", COUNT("ss_list_price") AS "b5_cnt", COUNT(DISTINCT "ss_list_price") AS "b5_cntd" +FROM (SELECT "ss_quantity", "ss_wholesale_cost", "ss_list_price", "ss_coupon_amt" +FROM "store_sales") AS "t" +WHERE ("ss_list_price" BETWEEN 135 AND 145 OR "ss_coupon_amt" BETWEEN 14180 AND 15180 OR "ss_wholesale_cost" BETWEEN 38 AND 58) AND "ss_quantity" BETWEEN 21 AND 25 + hive.sql.query.fieldNames b5_lp,b5_cnt,b5_cntd + hive.sql.query.fieldTypes decimal(11,6),bigint,bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: b5_lp (type: decimal(11,6)), b5_cnt (type: bigint), b5_cntd (type: bigint) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)), _col1 (type: bigint), _col2 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_list_price") / COUNT("ss_list_price") AS DECIMAL(11, 6)) AS "b4_lp", COUNT("ss_list_price") AS "b4_cnt", COUNT(DISTINCT "ss_list_price") AS "b4_cntd" +FROM (SELECT "ss_quantity", "ss_wholesale_cost", "ss_list_price", "ss_coupon_amt" +FROM "store_sales") AS "t" +WHERE ("ss_list_price" BETWEEN 142 AND 152 OR "ss_coupon_amt" BETWEEN 3054 AND 4054 OR "ss_wholesale_cost" BETWEEN 80 AND 100) AND "ss_quantity" BETWEEN 16 AND 20 + hive.sql.query.fieldNames b4_lp,b4_cnt,b4_cntd + hive.sql.query.fieldTypes decimal(11,6),bigint,bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: b4_lp (type: decimal(11,6)), b4_cnt (type: bigint), b4_cntd (type: bigint) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 128 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)), _col1 (type: bigint), _col2 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 257 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 257 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(11,6)), _col4 (type: bigint), _col5 (type: bigint) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 1 Data size: 386 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 386 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(11,6)), _col4 (type: bigint), _col5 (type: bigint), _col6 (type: decimal(11,6)), _col7 (type: bigint), _col8 (type: bigint) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11 + Statistics: Num rows: 1 Data size: 515 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 515 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(11,6)), _col4 (type: bigint), _col5 (type: bigint), _col6 (type: decimal(11,6)), _col7 (type: bigint), _col8 (type: bigint), _col9 (type: decimal(11,6)), _col10 (type: bigint), _col11 (type: bigint) + Reducer 5 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14 + Statistics: Num rows: 1 Data size: 644 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 644 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(11,6)), _col4 (type: bigint), _col5 (type: bigint), _col6 (type: decimal(11,6)), _col7 (type: bigint), _col8 (type: bigint), _col9 (type: decimal(11,6)), _col10 (type: bigint), _col11 (type: bigint), _col12 (type: decimal(11,6)), _col13 (type: bigint), _col14 (type: bigint) + Reducer 6 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17 + Statistics: Num rows: 1 Data size: 773 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: decimal(11,6)), _col1 (type: bigint), _col2 (type: bigint), _col15 (type: decimal(11,6)), _col16 (type: bigint), _col17 (type: bigint), _col12 (type: decimal(11,6)), _col13 (type: bigint), _col14 (type: bigint), _col9 (type: decimal(11,6)), _col10 (type: bigint), _col11 (type: bigint), _col6 (type: decimal(11,6)), _col7 (type: bigint), _col8 (type: bigint), _col3 (type: decimal(11,6)), _col4 (type: bigint), _col5 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17 + Statistics: Num rows: 1 Data size: 773 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 773 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query29.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query29.q.out new file mode 100644 index 000000000000..4659b6b2b620 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query29.q.out @@ -0,0 +1,58 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t27"."i_item_id", "t27"."i_item_desc", "t27"."s_store_id", "t27"."s_store_name", "t27"."$f4", "t27"."$f5", "t27"."$f6" +FROM (SELECT "t10"."i_item_id", "t10"."i_item_desc", "t7"."s_store_id", "t7"."s_store_name", SUM("t1"."ss_quantity") AS "$f4", SUM("t24"."sr_return_quantity") AS "$f5", SUM("t24"."cs_quantity") AS "$f6" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ticket_number", "ss_quantity" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ticket_number", "ss_quantity" +FROM "store_sales") AS "t" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL AND "ss_ticket_number" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_moy" = 4 AND "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "s_store_sk", "s_store_id", "s_store_name" +FROM (SELECT "s_store_sk", "s_store_id", "s_store_name" +FROM "store") AS "t5" +WHERE "s_store_sk" IS NOT NULL) AS "t7" ON "t1"."ss_store_sk" = "t7"."s_store_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id", "i_item_desc" +FROM (SELECT "i_item_sk", "i_item_id", "i_item_desc" +FROM "item") AS "t8" +WHERE "i_item_sk" IS NOT NULL) AS "t10" ON "t1"."ss_item_sk" = "t10"."i_item_sk" +INNER JOIN (SELECT "t13"."sr_returned_date_sk", "t13"."sr_item_sk", "t13"."sr_customer_sk", "t13"."sr_ticket_number", "t13"."sr_return_quantity", "t16"."d_date_sk", "t23"."cs_sold_date_sk", "t23"."cs_bill_customer_sk", "t23"."cs_item_sk", "t23"."cs_quantity", "t23"."d_date_sk" AS "d_date_sk0" +FROM (SELECT "sr_returned_date_sk", "sr_item_sk", "sr_customer_sk", "sr_ticket_number", "sr_return_quantity" +FROM (SELECT "sr_returned_date_sk", "sr_item_sk", "sr_customer_sk", "sr_ticket_number", "sr_return_quantity" +FROM "store_returns") AS "t11" +WHERE "sr_customer_sk" IS NOT NULL AND "sr_item_sk" IS NOT NULL AND "sr_ticket_number" IS NOT NULL AND "sr_returned_date_sk" IS NOT NULL) AS "t13" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t14" +WHERE "d_moy" BETWEEN 4 AND 7 AND "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t16" ON "t13"."sr_returned_date_sk" = "t16"."d_date_sk" +INNER JOIN (SELECT "t19"."cs_sold_date_sk", "t19"."cs_bill_customer_sk", "t19"."cs_item_sk", "t19"."cs_quantity", "t22"."d_date_sk" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk", "cs_quantity" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk", "cs_quantity" +FROM "catalog_sales") AS "t17" +WHERE "cs_bill_customer_sk" IS NOT NULL AND "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t19" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t20" +WHERE "d_year" IN (1999, 2000, 2001) AND "d_date_sk" IS NOT NULL) AS "t22" ON "t19"."cs_sold_date_sk" = "t22"."d_date_sk") AS "t23" ON "t13"."sr_customer_sk" = "t23"."cs_bill_customer_sk" AND "t13"."sr_item_sk" = "t23"."cs_item_sk") AS "t24" ON "t1"."ss_customer_sk" = "t24"."sr_customer_sk" AND "t1"."ss_item_sk" = "t24"."sr_item_sk" AND "t1"."ss_ticket_number" = "t24"."sr_ticket_number" +GROUP BY "t7"."s_store_id", "t7"."s_store_name", "t10"."i_item_id", "t10"."i_item_desc" +ORDER BY "t10"."i_item_id", "t10"."i_item_desc", "t7"."s_store_id", "t7"."s_store_name" +FETCH NEXT 100 ROWS ONLY) AS "t27" + hive.sql.query.fieldNames i_item_id,i_item_desc,s_store_id,s_store_name,$f4,$f5,$f6 + hive.sql.query.fieldTypes string,string,string,string,bigint,bigint,bigint + hive.sql.query.split false + Select Operator + expressions: i_item_id (type: string), i_item_desc (type: string), s_store_id (type: string), s_store_name (type: string), $f4 (type: bigint), $f5 (type: bigint), $f6 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query3.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query3.q.out new file mode 100644 index 000000000000..0b093de30712 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query3.q.out @@ -0,0 +1,36 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t9"."d_year", "t9"."i_brand_id", "t9"."i_brand", "t9"."$f3" +FROM (SELECT "t4"."d_year", "t7"."i_brand_id", "t7"."i_brand", SUM("t1"."ss_ext_sales_price") AS "$f3" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_year" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_moy" = 12 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand_id", "i_brand" +FROM (SELECT "i_item_sk", "i_brand_id", "i_brand", "i_manufact_id" +FROM "item") AS "t5" +WHERE "i_manufact_id" = 436 AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" +GROUP BY "t4"."d_year", "t7"."i_brand_id", "t7"."i_brand" +ORDER BY "t4"."d_year", SUM("t1"."ss_ext_sales_price") DESC, "t7"."i_brand_id" +FETCH NEXT 100 ROWS ONLY) AS "t9" + hive.sql.query.fieldNames d_year,i_brand_id,i_brand,$f3 + hive.sql.query.fieldTypes int,int,string,decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: d_year (type: int), i_brand_id (type: int), i_brand (type: string), $f3 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query30.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query30.q.out new file mode 100644 index 000000000000..4a51ef50c456 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query30.q.out @@ -0,0 +1,64 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "t32"."c_customer_id", "t32"."c_salutation", "t32"."c_first_name", "t32"."c_last_name", "t32"."c_preferred_cust_flag", "t32"."c_birth_day", "t32"."c_birth_month", "t32"."c_birth_year", "t32"."c_birth_country", "t32"."c_login", "t32"."c_email_address", "t32"."c_last_review_date_sk", "t32"."ctr_total_return" +FROM (SELECT "t1"."c_customer_id", "t1"."c_salutation", "t1"."c_first_name", "t1"."c_last_name", "t1"."c_preferred_cust_flag", "t1"."c_birth_day", "t1"."c_birth_month", "t1"."c_birth_year", "t1"."c_birth_country", "t1"."c_login", "t1"."c_email_address", "t1"."c_last_review_date_sk", "t30"."$f2" AS "ctr_total_return" +FROM (SELECT "c_customer_sk", "c_customer_id", "c_current_addr_sk", "c_salutation", "c_first_name", "c_last_name", "c_preferred_cust_flag", "c_birth_day", "c_birth_month", "c_birth_year", "c_birth_country", "c_login", "c_email_address", "c_last_review_date_sk" +FROM (SELECT "c_customer_sk", "c_customer_id", "c_current_addr_sk", "c_salutation", "c_first_name", "c_last_name", "c_preferred_cust_flag", "c_birth_day", "c_birth_month", "c_birth_year", "c_birth_country", "c_login", "c_email_address", "c_last_review_date_sk" +FROM "customer") AS "t" +WHERE "c_current_addr_sk" IS NOT NULL AND "c_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk" +FROM (SELECT "ca_address_sk", "ca_state" +FROM "customer_address") AS "t2" +WHERE "ca_state" = 'IL' AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."c_current_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "t16"."wr_returning_customer_sk", "t16"."ca_state", "t16"."$f2", "t29"."_o__c0", "t29"."ctr_state" +FROM (SELECT "t7"."wr_returning_customer_sk", "t13"."ca_state", SUM("t7"."wr_return_amt") AS "$f2" +FROM (SELECT "wr_returned_date_sk", "wr_returning_customer_sk", "wr_returning_addr_sk", "wr_return_amt" +FROM (SELECT "wr_returned_date_sk", "wr_returning_customer_sk", "wr_returning_addr_sk", "wr_return_amt" +FROM "web_returns") AS "t5" +WHERE "wr_returned_date_sk" IS NOT NULL AND "wr_returning_addr_sk" IS NOT NULL AND "wr_returning_customer_sk" IS NOT NULL) AS "t7" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t8" +WHERE "d_year" = 2002 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t7"."wr_returned_date_sk" = "t10"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_state" +FROM (SELECT "ca_address_sk", "ca_state" +FROM "customer_address") AS "t11" +WHERE "ca_address_sk" IS NOT NULL AND "ca_state" IS NOT NULL) AS "t13" ON "t7"."wr_returning_addr_sk" = "t13"."ca_address_sk" +GROUP BY "t7"."wr_returning_customer_sk", "t13"."ca_state" +HAVING SUM("t7"."wr_return_amt") IS NOT NULL) AS "t16" +INNER JOIN (SELECT CAST(SUM("t26"."$f2") / COUNT("t26"."$f2") AS DECIMAL(19, 6)) * 1.2 AS "_o__c0", "t26"."ca_state" AS "ctr_state" +FROM (SELECT "t19"."wr_returning_customer_sk", "t25"."ca_state", SUM("t19"."wr_return_amt") AS "$f2" +FROM (SELECT "wr_returned_date_sk", "wr_returning_customer_sk", "wr_returning_addr_sk", "wr_return_amt" +FROM (SELECT "wr_returned_date_sk", "wr_returning_customer_sk", "wr_returning_addr_sk", "wr_return_amt" +FROM "web_returns") AS "t17" +WHERE "wr_returned_date_sk" IS NOT NULL AND "wr_returning_addr_sk" IS NOT NULL) AS "t19" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t20" +WHERE "d_year" = 2002 AND "d_date_sk" IS NOT NULL) AS "t22" ON "t19"."wr_returned_date_sk" = "t22"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_state" +FROM (SELECT "ca_address_sk", "ca_state" +FROM "customer_address") AS "t23" +WHERE "ca_address_sk" IS NOT NULL AND "ca_state" IS NOT NULL) AS "t25" ON "t19"."wr_returning_addr_sk" = "t25"."ca_address_sk" +GROUP BY "t19"."wr_returning_customer_sk", "t25"."ca_state") AS "t26" +GROUP BY "t26"."ca_state" +HAVING CAST(SUM("t26"."$f2") / COUNT("t26"."$f2") AS DECIMAL(19, 6)) IS NOT NULL) AS "t29" ON "t16"."ca_state" = "t29"."ctr_state" AND "t16"."$f2" > "t29"."_o__c0") AS "t30" ON "t1"."c_customer_sk" = "t30"."wr_returning_customer_sk" +ORDER BY "t1"."c_customer_id", "t1"."c_salutation", "t1"."c_first_name", "t1"."c_last_name", "t1"."c_preferred_cust_flag", "t1"."c_birth_day", "t1"."c_birth_month", "t1"."c_birth_year", "t1"."c_birth_country", "t1"."c_login", "t1"."c_email_address", "t1"."c_last_review_date_sk", "t30"."$f2" +FETCH NEXT 100 ROWS ONLY) AS "t32" + hive.sql.query.fieldNames c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date_sk,ctr_total_return + hive.sql.query.fieldTypes string,string,string,string,string,int,int,int,string,string,string,string,decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: c_customer_id (type: string), c_salutation (type: string), c_first_name (type: string), c_last_name (type: string), c_preferred_cust_flag (type: string), c_birth_day (type: int), c_birth_month (type: int), c_birth_year (type: int), c_birth_country (type: string), c_login (type: string), c_email_address (type: string), c_last_review_date_sk (type: string), ctr_total_return (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query31.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query31.q.out new file mode 100644 index 000000000000..75b5ac48b61d --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query31.q.out @@ -0,0 +1,105 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t61"."ca_county", CAST(2000 AS INTEGER) AS "d_year", "t30"."$f3" / "t9"."$f3" AS "web_q1_q2_increase", "t61"."$f10" / "t61"."$f1" AS "store_q1_q2_increase", "t19"."$f1" / "t30"."$f3" AS "web_q2_q3_increase", "t61"."$f11" / "t61"."$f10" AS "store_q2_q3_increase" +FROM (SELECT "t7"."ca_county" AS "$f0", SUM("t1"."ws_ext_sales_price") AS "$f3", SUM("t1"."ws_ext_sales_price") > 0 AS "EXPR$4" +FROM (SELECT "ws_sold_date_sk", "ws_bill_addr_sk", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_bill_addr_sk", "ws_ext_sales_price" +FROM "web_sales") AS "t" +WHERE "ws_sold_date_sk" IS NOT NULL AND "ws_bill_addr_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_qoy" +FROM "date_dim") AS "t2" +WHERE "d_qoy" = 1 AND "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_county" +FROM (SELECT "ca_address_sk", "ca_county" +FROM "customer_address") AS "t5" +WHERE "ca_address_sk" IS NOT NULL AND "ca_county" IS NOT NULL) AS "t7" ON "t1"."ws_bill_addr_sk" = "t7"."ca_address_sk" +GROUP BY "t7"."ca_county") AS "t9" +INNER JOIN (SELECT "t18"."ca_county", SUM("t12"."ws_ext_sales_price") AS "$f1" +FROM (SELECT "ws_sold_date_sk", "ws_bill_addr_sk", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_bill_addr_sk", "ws_ext_sales_price" +FROM "web_sales") AS "t10" +WHERE "ws_sold_date_sk" IS NOT NULL AND "ws_bill_addr_sk" IS NOT NULL) AS "t12" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_qoy" +FROM "date_dim") AS "t13" +WHERE "d_qoy" = 3 AND "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t15" ON "t12"."ws_sold_date_sk" = "t15"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_county" +FROM (SELECT "ca_address_sk", "ca_county" +FROM "customer_address") AS "t16" +WHERE "ca_address_sk" IS NOT NULL AND "ca_county" IS NOT NULL) AS "t18" ON "t12"."ws_bill_addr_sk" = "t18"."ca_address_sk" +GROUP BY "t18"."ca_county") AS "t19" ON "t9"."$f0" = "t19"."ca_county" +INNER JOIN (SELECT "t28"."ca_county" AS "$f0", SUM("t22"."ws_ext_sales_price") AS "$f3", SUM("t22"."ws_ext_sales_price") > 0 AS "EXPR$4" +FROM (SELECT "ws_sold_date_sk", "ws_bill_addr_sk", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_bill_addr_sk", "ws_ext_sales_price" +FROM "web_sales") AS "t20" +WHERE "ws_sold_date_sk" IS NOT NULL AND "ws_bill_addr_sk" IS NOT NULL) AS "t22" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_qoy" +FROM "date_dim") AS "t23" +WHERE "d_qoy" = 2 AND "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t25" ON "t22"."ws_sold_date_sk" = "t25"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_county" +FROM (SELECT "ca_address_sk", "ca_county" +FROM "customer_address") AS "t26" +WHERE "ca_address_sk" IS NOT NULL AND "ca_county" IS NOT NULL) AS "t28" ON "t22"."ws_bill_addr_sk" = "t28"."ca_address_sk" +GROUP BY "t28"."ca_county") AS "t30" ON "t9"."$f0" = "t30"."$f0" +INNER JOIN (SELECT "t40"."ca_county", "t40"."$f1", "t50"."ca_county" AS "ca_county0", "t50"."$f1" AS "$f10", "t60"."ca_county" AS "ca_county1", "t60"."$f1" AS "$f11" +FROM (SELECT "t39"."ca_county", SUM("t33"."ss_ext_sales_price") AS "$f1" +FROM (SELECT "ss_sold_date_sk", "ss_addr_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_addr_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t31" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_addr_sk" IS NOT NULL) AS "t33" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_qoy" +FROM "date_dim") AS "t34" +WHERE "d_qoy" = 1 AND "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t36" ON "t33"."ss_sold_date_sk" = "t36"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_county" +FROM (SELECT "ca_address_sk", "ca_county" +FROM "customer_address") AS "t37" +WHERE "ca_address_sk" IS NOT NULL AND "ca_county" IS NOT NULL) AS "t39" ON "t33"."ss_addr_sk" = "t39"."ca_address_sk" +GROUP BY "t39"."ca_county") AS "t40" +INNER JOIN (SELECT "t49"."ca_county", SUM("t43"."ss_ext_sales_price") AS "$f1" +FROM (SELECT "ss_sold_date_sk", "ss_addr_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_addr_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t41" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_addr_sk" IS NOT NULL) AS "t43" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_qoy" +FROM "date_dim") AS "t44" +WHERE "d_qoy" = 2 AND "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t46" ON "t43"."ss_sold_date_sk" = "t46"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_county" +FROM (SELECT "ca_address_sk", "ca_county" +FROM "customer_address") AS "t47" +WHERE "ca_address_sk" IS NOT NULL AND "ca_county" IS NOT NULL) AS "t49" ON "t43"."ss_addr_sk" = "t49"."ca_address_sk" +GROUP BY "t49"."ca_county") AS "t50" ON "t40"."ca_county" = "t50"."ca_county" +INNER JOIN (SELECT "t59"."ca_county", SUM("t53"."ss_ext_sales_price") AS "$f1" +FROM (SELECT "ss_sold_date_sk", "ss_addr_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_addr_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t51" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_addr_sk" IS NOT NULL) AS "t53" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_qoy" +FROM "date_dim") AS "t54" +WHERE "d_qoy" = 3 AND "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t56" ON "t53"."ss_sold_date_sk" = "t56"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_county" +FROM (SELECT "ca_address_sk", "ca_county" +FROM "customer_address") AS "t57" +WHERE "ca_address_sk" IS NOT NULL AND "ca_county" IS NOT NULL) AS "t59" ON "t53"."ss_addr_sk" = "t59"."ca_address_sk" +GROUP BY "t59"."ca_county") AS "t60" ON "t50"."ca_county" = "t60"."ca_county") AS "t61" ON "t9"."$f0" = "t61"."ca_county" AND CASE WHEN "t61"."$f1" > 0 THEN CASE WHEN "t9"."EXPR$4" THEN "t30"."$f3" / "t9"."$f3" > "t61"."$f10" / "t61"."$f1" ELSE FALSE END ELSE FALSE END AND CASE WHEN "t61"."$f10" > 0 THEN CASE WHEN "t30"."EXPR$4" THEN "t19"."$f1" / "t30"."$f3" > "t61"."$f11" / "t61"."$f10" ELSE FALSE END ELSE FALSE END + hive.sql.query.fieldNames ca_county,d_year,web_q1_q2_increase,store_q1_q2_increase,web_q2_q3_increase,store_q2_q3_increase + hive.sql.query.fieldTypes string,int,decimal(37,20),decimal(37,20),decimal(37,20),decimal(37,20) + hive.sql.query.split false + Select Operator + expressions: ca_county (type: string), d_year (type: int), web_q1_q2_increase (type: decimal(37,20)), store_q1_q2_increase (type: decimal(37,20)), web_q2_q3_increase (type: decimal(37,20)), store_q2_q3_increase (type: decimal(37,20)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query32.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query32.q.out new file mode 100644 index 000000000000..5e540809fe2c --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query32.q.out @@ -0,0 +1,43 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT SUM("t1"."cs_ext_discount_amt") AS "$f0" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_ext_discount_amt" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_ext_discount_amt" +FROM "catalog_sales") AS "t" +WHERE "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL AND "cs_ext_discount_amt" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "i_item_sk" +FROM (SELECT "i_item_sk", "i_manufact_id" +FROM "item") AS "t2" +WHERE "i_manufact_id" = 269 AND "i_item_sk" IS NOT NULL) AS "t4" ON "t1"."cs_item_sk" = "t4"."i_item_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t5" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '1998-03-18 00:00:00.000000000' AND TIMESTAMP '1998-06-16 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."cs_sold_date_sk" = "t7"."d_date_sk" +INNER JOIN (SELECT 1.3 * CAST(SUM("t10"."cs_ext_discount_amt") / COUNT("t10"."cs_ext_discount_amt") AS DECIMAL(11, 6)) AS "_o__c0", "t10"."cs_item_sk" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_ext_discount_amt" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_ext_discount_amt" +FROM "catalog_sales") AS "t8" +WHERE "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t10" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t11" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '1998-03-18 00:00:00.000000000' AND TIMESTAMP '1998-06-16 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t13" ON "t10"."cs_sold_date_sk" = "t13"."d_date_sk" +GROUP BY "t10"."cs_item_sk" +HAVING CAST(SUM("t10"."cs_ext_discount_amt") / COUNT("t10"."cs_ext_discount_amt") AS DECIMAL(11, 6)) IS NOT NULL) AS "t16" ON "t4"."i_item_sk" = "t16"."cs_item_sk" AND "t1"."cs_ext_discount_amt" > "t16"."_o__c0" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: $f0 (type: decimal(17,2)) + outputColumnNames: _col0 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query33.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query33.q.out new file mode 100644 index 000000000000..be7443fa435a --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query33.q.out @@ -0,0 +1,370 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 10 <- Map 13 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 11 <- Reducer 10 (SIMPLE_EDGE), Union 4 (CONTAINS) + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Union 4 (CONTAINS) + Reducer 5 <- Union 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) + Reducer 8 <- Map 12 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 9 <- Reducer 8 (SIMPLE_EDGE), Union 4 (CONTAINS) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_sold_date_sk", "t1"."ss_item_sk", "t1"."ss_addr_sk", "t1"."ss_ext_sales_price", "t10"."d_date_sk", "t10"."d_year", "t10"."d_moy", "t4"."ca_address_sk", "t4"."ca_gmt_offset", "t7"."i_item_sk", "t7"."i_manufact_id" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_addr_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_addr_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_addr_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_gmt_offset" +FROM (SELECT "ca_address_sk", "ca_gmt_offset" +FROM "customer_address") AS "t2" +WHERE "ca_gmt_offset" = -6 AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."ss_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "i_item_sk", "i_manufact_id" +FROM (SELECT "i_item_sk", "i_manufact_id" +FROM "item") AS "t5" +WHERE "i_manufact_id" IS NOT NULL AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t8" +WHERE "d_year" = 1999 AND "d_moy" = 3 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."ss_sold_date_sk" = "t10"."d_date_sk" + hive.sql.query.fieldNames ss_sold_date_sk,ss_item_sk,ss_addr_sk,ss_ext_sales_price,d_date_sk,d_year,d_moy,ca_address_sk,ca_gmt_offset,i_item_sk,i_manufact_id + hive.sql.query.fieldTypes int,bigint,int,decimal(7,2),int,int,int,int,decimal(5,2),bigint,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_ext_sales_price (type: decimal(7,2)), i_manufact_id (type: int) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col10 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col10 (type: int) + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 12 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t1"."cs_sold_date_sk", "t1"."cs_bill_addr_sk", "t1"."cs_item_sk", "t1"."cs_ext_sales_price", "t10"."d_date_sk", "t10"."d_year", "t10"."d_moy", "t4"."ca_address_sk", "t4"."ca_gmt_offset", "t7"."i_item_sk", "t7"."i_manufact_id" +FROM (SELECT "cs_sold_date_sk", "cs_bill_addr_sk", "cs_item_sk", "cs_ext_sales_price" +FROM (SELECT "cs_sold_date_sk", "cs_bill_addr_sk", "cs_item_sk", "cs_ext_sales_price" +FROM "catalog_sales") AS "t" +WHERE "cs_sold_date_sk" IS NOT NULL AND "cs_bill_addr_sk" IS NOT NULL AND "cs_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_gmt_offset" +FROM (SELECT "ca_address_sk", "ca_gmt_offset" +FROM "customer_address") AS "t2" +WHERE "ca_gmt_offset" = -6 AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."cs_bill_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "i_item_sk", "i_manufact_id" +FROM (SELECT "i_item_sk", "i_manufact_id" +FROM "item") AS "t5" +WHERE "i_manufact_id" IS NOT NULL AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."cs_item_sk" = "t7"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t8" +WHERE "d_year" = 1999 AND "d_moy" = 3 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."cs_sold_date_sk" = "t10"."d_date_sk" + hive.sql.query.fieldNames cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price,d_date_sk,d_year,d_moy,ca_address_sk,ca_gmt_offset,i_item_sk,i_manufact_id + hive.sql.query.fieldTypes int,int,bigint,decimal(7,2),int,int,int,int,decimal(5,2),bigint,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_ext_sales_price (type: decimal(7,2)), i_manufact_id (type: int) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col10 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col10 (type: int) + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 13 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t1"."ws_sold_date_sk", "t1"."ws_item_sk", "t1"."ws_bill_addr_sk", "t1"."ws_ext_sales_price", "t10"."d_date_sk", "t10"."d_year", "t10"."d_moy", "t4"."ca_address_sk", "t4"."ca_gmt_offset", "t7"."i_item_sk", "t7"."i_manufact_id" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_addr_sk", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_addr_sk", "ws_ext_sales_price" +FROM "web_sales") AS "t" +WHERE "ws_sold_date_sk" IS NOT NULL AND "ws_bill_addr_sk" IS NOT NULL AND "ws_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_gmt_offset" +FROM (SELECT "ca_address_sk", "ca_gmt_offset" +FROM "customer_address") AS "t2" +WHERE "ca_gmt_offset" = -6 AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."ws_bill_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "i_item_sk", "i_manufact_id" +FROM (SELECT "i_item_sk", "i_manufact_id" +FROM "item") AS "t5" +WHERE "i_manufact_id" IS NOT NULL AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ws_item_sk" = "t7"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t8" +WHERE "d_year" = 1999 AND "d_moy" = 3 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."ws_sold_date_sk" = "t10"."d_date_sk" + hive.sql.query.fieldNames ws_sold_date_sk,ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price,d_date_sk,d_year,d_moy,ca_address_sk,ca_gmt_offset,i_item_sk,i_manufact_id + hive.sql.query.fieldTypes int,bigint,int,decimal(7,2),int,int,int,int,decimal(5,2),bigint,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_ext_sales_price (type: decimal(7,2)), i_manufact_id (type: int) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col10 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col10 (type: int) + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: item + properties: + hive.sql.query SELECT "i_manufact_id" +FROM (SELECT "i_category", "i_manufact_id" +FROM "item") AS "t" +WHERE "i_category" = 'Books' AND "i_manufact_id" IS NOT NULL + hive.sql.query.fieldNames i_manufact_id + hive.sql.query.fieldTypes int + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_manufact_id (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 10 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col10 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3) + keys: _col10 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 11 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col1) + keys: _col0 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 3 Data size: 381 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 3 Data size: 381 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(27,2)) + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col10 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3) + keys: _col10 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col1) + keys: _col0 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 3 Data size: 381 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 3 Data size: 381 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(27,2)) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: + + keys: _col1 (type: decimal(27,2)) + null sort order: z + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Reduce Output Operator + key expressions: _col1 (type: decimal(27,2)) + null sort order: z + sort order: + + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: int), KEY.reducesinkkey0 (type: decimal(27,2)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 8 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col10 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3) + keys: _col10 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 9 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 127 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col1) + keys: _col0 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 3 Data size: 381 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 3 Data size: 381 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(27,2)) + Union 4 + Vertex: Union 4 + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query34.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query34.q.out new file mode 100644 index 000000000000..bf1c74780bd8 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query34.q.out @@ -0,0 +1,46 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "t19"."c_last_name", "t19"."c_first_name", "t19"."c_salutation", "t19"."c_preferred_cust_flag", "t19"."ss_ticket_number", "t19"."cnt" +FROM (SELECT "t1"."c_last_name", "t1"."c_first_name", "t1"."c_salutation", "t1"."c_preferred_cust_flag", "t17"."ss_ticket_number", "t17"."$f2" AS "cnt" +FROM (SELECT "c_customer_sk", "c_salutation", "c_first_name", "c_last_name", "c_preferred_cust_flag" +FROM (SELECT "c_customer_sk", "c_salutation", "c_first_name", "c_last_name", "c_preferred_cust_flag" +FROM "customer") AS "t" +WHERE "c_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ss_ticket_number", "ss_customer_sk", "$f2" +FROM (SELECT "t4"."ss_ticket_number", "t4"."ss_customer_sk", COUNT(*) AS "$f2" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_hdemo_sk", "ss_store_sk", "ss_ticket_number" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_hdemo_sk", "ss_store_sk", "ss_ticket_number" +FROM "store_sales") AS "t2" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL AND "ss_hdemo_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL) AS "t4" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_dom" +FROM "date_dim") AS "t5" +WHERE ("d_dom" BETWEEN 1 AND 3 OR "d_dom" BETWEEN 25 AND 28) AND "d_year" IN (2000, 2001, 2002) AND "d_date_sk" IS NOT NULL) AS "t7" ON "t4"."ss_sold_date_sk" = "t7"."d_date_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_county" +FROM "store") AS "t8" +WHERE "s_county" IN ('Barrow County', 'Fairfield County', 'Huron County', 'Jackson County', 'Kittitas County', 'Maverick County', 'Mobile County', 'Pennington County') AND "s_store_sk" IS NOT NULL) AS "t10" ON "t4"."ss_store_sk" = "t10"."s_store_sk" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_buy_potential", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t11" +WHERE "hd_vehicle_count" > 0 AND "hd_buy_potential" IN ('>10000', 'unknown') AND CASE WHEN "hd_vehicle_count" > 0 THEN CAST("hd_dep_count" AS DOUBLE PRECISION) / CAST("hd_vehicle_count" AS DOUBLE PRECISION) > 1.2 ELSE FALSE END AND "hd_demo_sk" IS NOT NULL) AS "t13" ON "t4"."ss_hdemo_sk" = "t13"."hd_demo_sk" +GROUP BY "t4"."ss_customer_sk", "t4"."ss_ticket_number") AS "t15" +WHERE "t15"."$f2" BETWEEN 15 AND 20) AS "t17" ON "t1"."c_customer_sk" = "t17"."ss_customer_sk" +ORDER BY "t1"."c_last_name", "t1"."c_first_name", "t1"."c_salutation", "t1"."c_preferred_cust_flag" DESC) AS "t19" + hive.sql.query.fieldNames c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number,cnt + hive.sql.query.fieldTypes string,string,string,string,bigint,bigint + hive.sql.query.split false + Select Operator + expressions: c_last_name (type: string), c_first_name (type: string), c_salutation (type: string), c_preferred_cust_flag (type: string), ss_ticket_number (type: bigint), cnt (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query35.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query35.q.out new file mode 100644 index 000000000000..c98f1b80cd17 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query35.q.out @@ -0,0 +1,268 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Map 9 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: c + properties: + hive.sql.query SELECT "t1"."c_customer_sk", "t1"."c_current_cdemo_sk", "t1"."c_current_addr_sk", "t4"."ca_address_sk", "t4"."ca_state", "t7"."cd_demo_sk", "t7"."cd_gender", "t7"."cd_marital_status", "t7"."cd_dep_count", "t7"."cd_dep_employed_count", "t7"."cd_dep_college_count" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_addr_sk" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_addr_sk" +FROM "customer") AS "t" +WHERE "c_current_addr_sk" IS NOT NULL AND "c_current_cdemo_sk" IS NOT NULL AND "c_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_state" +FROM (SELECT "ca_address_sk", "ca_state" +FROM "customer_address") AS "t2" +WHERE "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."c_current_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "cd_demo_sk", "cd_gender", "cd_marital_status", "cd_dep_count", "cd_dep_employed_count", "cd_dep_college_count" +FROM (SELECT "cd_demo_sk", "cd_gender", "cd_marital_status", "cd_dep_count", "cd_dep_employed_count", "cd_dep_college_count" +FROM "customer_demographics") AS "t5" +WHERE "cd_demo_sk" IS NOT NULL) AS "t7" ON "t1"."c_current_cdemo_sk" = "t7"."cd_demo_sk" + hive.sql.query.fieldNames c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,ca_address_sk,ca_state,cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count + hive.sql.query.fieldTypes int,int,int,int,string,int,string,string,int,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 568 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_customer_sk (type: int), ca_state (type: string), cd_gender (type: string), cd_marital_status (type: string), cd_dep_count (type: int), cd_dep_employed_count (type: int), cd_dep_college_count (type: int) + outputColumnNames: _col0, _col4, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 1 Data size: 568 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 568 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: string), _col6 (type: string), _col7 (type: string), _col8 (type: int), _col9 (type: int), _col10 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_customer_sk" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk" +FROM "store_sales") AS "t" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_qoy" +FROM "date_dim") AS "t2" +WHERE "d_qoy" < 4 AND "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames ss_customer_sk + hive.sql.query.fieldTypes int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_customer_sk (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 8 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT TRUE AS "literalTrue", "t1"."ws_bill_customer_sk" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk" +FROM "web_sales") AS "t" +WHERE "ws_bill_customer_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_qoy" +FROM "date_dim") AS "t2" +WHERE "d_qoy" < 4 AND "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_sold_date_sk" = "t4"."d_date_sk" +GROUP BY "t1"."ws_bill_customer_sk" + hive.sql.query.fieldNames literalTrue,ws_bill_customer_sk + hive.sql.query.fieldTypes boolean,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: literaltrue (type: boolean), ws_bill_customer_sk (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT TRUE AS "literalTrue", "t1"."cs_ship_customer_sk" +FROM (SELECT "cs_sold_date_sk", "cs_ship_customer_sk" +FROM (SELECT "cs_sold_date_sk", "cs_ship_customer_sk" +FROM "catalog_sales") AS "t" +WHERE "cs_ship_customer_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_qoy" +FROM "date_dim") AS "t2" +WHERE "d_qoy" < 4 AND "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_sold_date_sk" = "t4"."d_date_sk" +GROUP BY "t1"."cs_ship_customer_sk" + hive.sql.query.fieldNames literalTrue,cs_ship_customer_sk + hive.sql.query.fieldTypes boolean,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: literaltrue (type: boolean), cs_ship_customer_sk (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col0, _col4, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 1 Data size: 624 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 624 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: string), _col6 (type: string), _col7 (type: string), _col8 (type: int), _col9 (type: int), _col10 (type: int) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col1 (type: int) + outputColumnNames: _col0, _col4, _col6, _col7, _col8, _col9, _col10, _col11 + Statistics: Num rows: 1 Data size: 686 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 686 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: string), _col6 (type: string), _col7 (type: string), _col8 (type: int), _col9 (type: int), _col10 (type: int), _col11 (type: boolean) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col1 (type: int) + outputColumnNames: _col4, _col6, _col7, _col8, _col9, _col10, _col11, _col13 + Statistics: Num rows: 1 Data size: 754 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (_col11 is not null or _col13 is not null) (type: boolean) + Statistics: Num rows: 1 Data size: 754 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++++++ + keys: _col4 (type: string), _col6 (type: string), _col7 (type: string), _col8 (type: int), _col9 (type: int), _col10 (type: int) + null sort order: zzzzzz + Statistics: Num rows: 1 Data size: 754 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col4 (type: string), _col6 (type: string), _col7 (type: string), _col8 (type: int), _col9 (type: int), _col10 (type: int) + outputColumnNames: _col4, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 1 Data size: 754 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count(), sum(_col8), count(_col8), max(_col8), sum(_col9), count(_col9), max(_col9), sum(_col10), count(_col10), max(_col10) + keys: _col4 (type: string), _col6 (type: string), _col7 (type: string), _col8 (type: int), _col9 (type: int), _col10 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15 + Statistics: Num rows: 1 Data size: 754 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: int) + null sort order: zzzzzz + sort order: ++++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: int) + Statistics: Num rows: 1 Data size: 754 Basic stats: COMPLETE Column stats: NONE + value expressions: _col6 (type: bigint), _col7 (type: bigint), _col8 (type: bigint), _col9 (type: int), _col10 (type: bigint), _col11 (type: bigint), _col12 (type: int), _col13 (type: bigint), _col14 (type: bigint), _col15 (type: int) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0), sum(VALUE._col1), count(VALUE._col2), max(VALUE._col3), sum(VALUE._col4), count(VALUE._col5), max(VALUE._col6), sum(VALUE._col7), count(VALUE._col8), max(VALUE._col9) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string), KEY._col3 (type: int), KEY._col4 (type: int), KEY._col5 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15 + Statistics: Num rows: 1 Data size: 754 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col6 (type: bigint), (UDFToDouble(_col7) / _col8) (type: double), _col9 (type: int), _col7 (type: bigint), _col4 (type: int), (UDFToDouble(_col10) / _col11) (type: double), _col12 (type: int), _col10 (type: bigint), _col5 (type: int), (UDFToDouble(_col13) / _col14) (type: double), _col15 (type: int), _col13 (type: bigint), _col3 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col9, _col10, _col11, _col12, _col14, _col15, _col16, _col17 + Statistics: Num rows: 1 Data size: 754 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col17 (type: int), _col7 (type: int), _col12 (type: int) + null sort order: zzzzzz + sort order: ++++++ + Statistics: Num rows: 1 Data size: 754 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint), _col4 (type: double), _col5 (type: int), _col6 (type: bigint), _col9 (type: double), _col10 (type: int), _col11 (type: bigint), _col14 (type: double), _col15 (type: int), _col16 (type: bigint) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), VALUE._col0 (type: bigint), VALUE._col1 (type: double), VALUE._col2 (type: int), VALUE._col3 (type: bigint), KEY.reducesinkkey4 (type: int), VALUE._col0 (type: bigint), VALUE._col4 (type: double), VALUE._col5 (type: int), VALUE._col6 (type: bigint), KEY.reducesinkkey5 (type: int), VALUE._col0 (type: bigint), VALUE._col7 (type: double), VALUE._col8 (type: int), VALUE._col9 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16 + Statistics: Num rows: 1 Data size: 754 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 754 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 754 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query36.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query36.q.out new file mode 100644 index 000000000000..1a2e89a82989 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query36.q.out @@ -0,0 +1,149 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t10"."i_category" AS "$f0", "t10"."i_class" AS "$f1", "t1"."ss_net_profit" AS "$f2", "t1"."ss_ext_sales_price" AS "$f3" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_ext_sales_price", "ss_net_profit" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_ext_sales_price", "ss_net_profit" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t2" +WHERE "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_state" +FROM "store") AS "t5" +WHERE "s_state" IN ('AL', 'FL', 'GA', 'LA', 'MI', 'MO', 'SC', 'SD') AND "s_store_sk" IS NOT NULL) AS "t7" ON "t1"."ss_store_sk" = "t7"."s_store_sk" +INNER JOIN (SELECT "i_item_sk", "i_class", "i_category" +FROM (SELECT "i_item_sk", "i_class", "i_category" +FROM "item") AS "t8" +WHERE "i_item_sk" IS NOT NULL) AS "t10" ON "t1"."ss_item_sk" = "t10"."i_item_sk" + hive.sql.query.fieldNames $f0,$f1,$f2,$f3 + hive.sql.query.fieldTypes string,string,decimal(7,2),decimal(7,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: string), $f1 (type: string), $f2 (type: decimal(7,2)), $f3 (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col2), sum(_col3) + keys: _col0 (type: string), _col1 (type: string), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 3 Data size: 1776 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + Statistics: Num rows: 3 Data size: 1776 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: string), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col2 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: (grouping(_col4, 1L) + grouping(_col4, 0L)) (type: bigint), CASE WHEN ((grouping(_col4, 0L) = UDFToLong(0))) THEN (_col0) ELSE (CAST( null AS STRING)) END (type: string), (_col2 / _col3) (type: decimal(37,20)) + null sort order: aaz + sort order: +++ + Map-reduce partition columns: (grouping(_col4, 1L) + grouping(_col4, 0L)) (type: bigint), CASE WHEN ((grouping(_col4, 0L) = UDFToLong(0))) THEN (_col0) ELSE (CAST( null AS STRING)) END (type: string) + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: bigint) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: string), VALUE._col1 (type: string), VALUE._col2 (type: decimal(17,2)), VALUE._col3 (type: decimal(17,2)), VALUE._col4 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: string, _col2: decimal(17,2), _col3: decimal(17,2), _col4: bigint + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: (_col2 / _col3) ASC NULLS LAST + partition by: (grouping(_col4, 1L) + grouping(_col4, 0L)), CASE WHEN ((grouping(_col4, 0L) = UDFToLong(0))) THEN (_col0) ELSE (CAST( null AS STRING)) END + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: (_col2 / _col3) + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: -++ + keys: (grouping(_col4, 1L) + grouping(_col4, 0L)) (type: bigint), if(((grouping(_col4, 1L) + grouping(_col4, 0L)) = 0L), _col0, null) (type: string), rank_window_0 (type: int) + null sort order: azz + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: (_col2 / _col3) (type: decimal(37,20)), _col0 (type: string), _col1 (type: string), (grouping(_col4, 1L) + grouping(_col4, 0L)) (type: bigint), rank_window_0 (type: int), if(((grouping(_col4, 1L) + grouping(_col4, 0L)) = 0L), _col0, null) (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: bigint), _col5 (type: string), _col4 (type: int) + null sort order: azz + sort order: -++ + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(37,20)), _col1 (type: string), _col2 (type: string) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: decimal(37,20)), VALUE._col1 (type: string), VALUE._col2 (type: string), KEY.reducesinkkey0 (type: bigint), KEY.reducesinkkey2 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 592 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query37.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query37.q.out new file mode 100644 index 000000000000..4fd7121332e7 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query37.q.out @@ -0,0 +1,41 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: item + properties: + hive.sql.query SELECT "t13"."i_item_id", "t13"."i_item_desc", "t13"."i_current_price" +FROM (SELECT "t1"."i_item_id", "t1"."i_item_desc", "t1"."i_current_price" +FROM (SELECT "i_item_sk", "i_item_id", "i_item_desc", "i_current_price" +FROM (SELECT "i_item_sk", "i_item_id", "i_item_desc", "i_current_price", "i_manufact_id" +FROM "item") AS "t" +WHERE "i_manufact_id" IN (678, 849, 918, 964) AND "i_current_price" BETWEEN 22 AND 52 AND "i_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "cs_item_sk" +FROM (SELECT "cs_item_sk" +FROM "catalog_sales") AS "t2" +WHERE "cs_item_sk" IS NOT NULL) AS "t4" ON "t1"."i_item_sk" = "t4"."cs_item_sk" +INNER JOIN (SELECT "t7"."inv_date_sk", "t7"."inv_item_sk", "t10"."d_date_sk" +FROM (SELECT "inv_date_sk", "inv_item_sk" +FROM (SELECT "inv_date_sk", "inv_item_sk", "inv_quantity_on_hand" +FROM "inventory") AS "t5" +WHERE "inv_quantity_on_hand" BETWEEN 100 AND 500 AND "inv_item_sk" IS NOT NULL AND "inv_date_sk" IS NOT NULL) AS "t7" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t8" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '2001-06-02 00:00:00.000000000' AND TIMESTAMP '2001-08-01 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t10" ON "t7"."inv_date_sk" = "t10"."d_date_sk") AS "t11" ON "t1"."i_item_sk" = "t11"."inv_item_sk" +GROUP BY "t1"."i_item_id", "t1"."i_item_desc", "t1"."i_current_price" +ORDER BY "t1"."i_item_id" +FETCH NEXT 100 ROWS ONLY) AS "t13" + hive.sql.query.fieldNames i_item_id,i_item_desc,i_current_price + hive.sql.query.fieldTypes string,string,decimal(7,2) + hive.sql.query.split false + Select Operator + expressions: i_item_id (type: string), i_item_desc (type: string), i_current_price (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query38.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query38.q.out new file mode 100644 index 000000000000..a94198c507c9 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query38.q.out @@ -0,0 +1,144 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Map 1 <- Union 2 (CONTAINS) + Map 5 <- Union 2 (CONTAINS) + Map 6 <- Union 2 (CONTAINS) + Reducer 3 <- Union 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (CUSTOM_SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_last_name (type: string), c_first_name (type: string), d_date (type: string), $f3 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count(_col3) + keys: _col0 (type: string), _col1 (type: string), _col2 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 3 Data size: 1680 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string) + Statistics: Num rows: 3 Data size: 1680 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 5 + Map Operator Tree: + TableScan + alias: catalog_sales + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_last_name (type: string), c_first_name (type: string), d_date (type: string), $f3 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count(_col3) + keys: _col0 (type: string), _col1 (type: string), _col2 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 3 Data size: 1680 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string) + Statistics: Num rows: 3 Data size: 1680 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: web_sales + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_last_name (type: string), c_first_name (type: string), d_date (type: string), $f3 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count(_col3) + keys: _col0 (type: string), _col1 (type: string), _col2 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 3 Data size: 1680 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string) + Statistics: Num rows: 3 Data size: 1680 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col3 (type: bigint) + outputColumnNames: _col3 + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (_col3 = 3L) (type: boolean) + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + Select Operator + Statistics: Num rows: 1 Data size: 560 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count() + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 576 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 576 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + mode: mergepartial + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 576 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 576 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Union 2 + Vertex: Union 2 + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query39.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query39.q.out new file mode 100644 index 000000000000..902945996b34 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query39.q.out @@ -0,0 +1,58 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: inventory + properties: + hive.sql.query SELECT "t29"."w_warehouse_sk", "t29"."i_item_sk", CAST(4 AS INTEGER) AS "d_moy", "t29"."mean", "t29"."cov", "t29"."w_warehouse_sk0" AS "w_warehouse_sk1", "t29"."i_item_sk0" AS "i_item_sk1", CAST(5 AS INTEGER) AS "d_moy1", "t29"."mean0" AS "mean1", "t29"."cov0" AS "cov1" +FROM (SELECT "t13"."w_warehouse_sk", "t13"."i_item_sk", "t13"."mean", "t13"."cov", "t28"."w_warehouse_sk" AS "w_warehouse_sk0", "t28"."i_item_sk" AS "i_item_sk0", "t28"."mean" AS "mean0", "t28"."cov" AS "cov0" +FROM (SELECT "t9"."w_warehouse_sk", "t3"."i_item_sk", CAST(SUM("t0"."inv_quantity_on_hand") AS DOUBLE PRECISION) / COUNT("t0"."inv_quantity_on_hand") AS "mean", CASE WHEN CAST(SUM("t0"."inv_quantity_on_hand") AS DOUBLE PRECISION) / COUNT("t0"."inv_quantity_on_hand") = 0 THEN NULL ELSE POWER((SUM(CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION) * CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION)) - SUM(CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION)) * SUM(CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION)) / COUNT(CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION))) / CASE WHEN COUNT(CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION)) = 1 THEN NULL ELSE COUNT(CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION)) - 1 END, 0.5) / (CAST(SUM("t0"."inv_quantity_on_hand") AS DOUBLE PRECISION) / COUNT("t0"."inv_quantity_on_hand")) END AS "cov" +FROM (SELECT "inv_date_sk", "inv_item_sk", "inv_warehouse_sk", "inv_quantity_on_hand" +FROM "inventory" +WHERE "inv_item_sk" IS NOT NULL AND "inv_warehouse_sk" IS NOT NULL AND "inv_date_sk" IS NOT NULL) AS "t0" +INNER JOIN (SELECT "i_item_sk" +FROM (SELECT "i_item_sk" +FROM "item") AS "t1" +WHERE "i_item_sk" IS NOT NULL) AS "t3" ON "t0"."inv_item_sk" = "t3"."i_item_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t4" +WHERE "d_year" = 1999 AND "d_moy" = 4 AND "d_date_sk" IS NOT NULL) AS "t6" ON "t0"."inv_date_sk" = "t6"."d_date_sk" +INNER JOIN (SELECT "w_warehouse_sk", "w_warehouse_name" +FROM (SELECT "w_warehouse_sk", "w_warehouse_name" +FROM "warehouse") AS "t7" +WHERE "w_warehouse_sk" IS NOT NULL) AS "t9" ON "t0"."inv_warehouse_sk" = "t9"."w_warehouse_sk" +GROUP BY "t9"."w_warehouse_name", "t9"."w_warehouse_sk", "t3"."i_item_sk" +HAVING CASE WHEN CAST(SUM("t0"."inv_quantity_on_hand") AS DOUBLE PRECISION) / COUNT("t0"."inv_quantity_on_hand") = 0 THEN FALSE ELSE POWER((SUM(CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION) * CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION)) - SUM(CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION)) * SUM(CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION)) / COUNT(CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION))) / CASE WHEN COUNT(CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION)) = 1 THEN NULL ELSE COUNT(CAST("t0"."inv_quantity_on_hand" AS DOUBLE PRECISION)) - 1 END, 0.5) / (CAST(SUM("t0"."inv_quantity_on_hand") AS DOUBLE PRECISION) / COUNT("t0"."inv_quantity_on_hand")) > 1 END) AS "t13" +INNER JOIN (SELECT "t24"."w_warehouse_sk", "t18"."i_item_sk", CAST(SUM("t15"."inv_quantity_on_hand") AS DOUBLE PRECISION) / COUNT("t15"."inv_quantity_on_hand") AS "mean", CASE WHEN CAST(SUM("t15"."inv_quantity_on_hand") AS DOUBLE PRECISION) / COUNT("t15"."inv_quantity_on_hand") = 0 THEN NULL ELSE POWER((SUM(CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION) * CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION)) - SUM(CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION)) * SUM(CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION)) / COUNT(CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION))) / CASE WHEN COUNT(CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION)) = 1 THEN NULL ELSE COUNT(CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION)) - 1 END, 0.5) / (CAST(SUM("t15"."inv_quantity_on_hand") AS DOUBLE PRECISION) / COUNT("t15"."inv_quantity_on_hand")) END AS "cov" +FROM (SELECT "inv_date_sk", "inv_item_sk", "inv_warehouse_sk", "inv_quantity_on_hand" +FROM "inventory" +WHERE "inv_item_sk" IS NOT NULL AND "inv_warehouse_sk" IS NOT NULL AND "inv_date_sk" IS NOT NULL) AS "t15" +INNER JOIN (SELECT "i_item_sk" +FROM (SELECT "i_item_sk" +FROM "item") AS "t16" +WHERE "i_item_sk" IS NOT NULL) AS "t18" ON "t15"."inv_item_sk" = "t18"."i_item_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t19" +WHERE "d_year" = 1999 AND "d_moy" = 5 AND "d_date_sk" IS NOT NULL) AS "t21" ON "t15"."inv_date_sk" = "t21"."d_date_sk" +INNER JOIN (SELECT "w_warehouse_sk", "w_warehouse_name" +FROM (SELECT "w_warehouse_sk", "w_warehouse_name" +FROM "warehouse") AS "t22" +WHERE "w_warehouse_sk" IS NOT NULL) AS "t24" ON "t15"."inv_warehouse_sk" = "t24"."w_warehouse_sk" +GROUP BY "t24"."w_warehouse_name", "t24"."w_warehouse_sk", "t18"."i_item_sk" +HAVING CASE WHEN CAST(SUM("t15"."inv_quantity_on_hand") AS DOUBLE PRECISION) / COUNT("t15"."inv_quantity_on_hand") = 0 THEN FALSE ELSE POWER((SUM(CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION) * CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION)) - SUM(CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION)) * SUM(CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION)) / COUNT(CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION))) / CASE WHEN COUNT(CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION)) = 1 THEN NULL ELSE COUNT(CAST("t15"."inv_quantity_on_hand" AS DOUBLE PRECISION)) - 1 END, 0.5) / (CAST(SUM("t15"."inv_quantity_on_hand") AS DOUBLE PRECISION) / COUNT("t15"."inv_quantity_on_hand")) > 1 END) AS "t28" ON "t13"."i_item_sk" = "t28"."i_item_sk" AND "t13"."w_warehouse_sk" = "t28"."w_warehouse_sk" +ORDER BY "t13"."w_warehouse_sk", "t13"."i_item_sk", "t13"."mean", "t13"."cov", "t28"."mean", "t28"."cov") AS "t29" + hive.sql.query.fieldNames w_warehouse_sk,i_item_sk,d_moy,mean,cov,w_warehouse_sk1,i_item_sk1,d_moy1,mean1,cov1 + hive.sql.query.fieldTypes int,bigint,int,double,double,int,bigint,int,double,double + hive.sql.query.split false + Select Operator + expressions: w_warehouse_sk (type: int), i_item_sk (type: bigint), d_moy (type: int), mean (type: double), cov (type: double), w_warehouse_sk1 (type: int), i_item_sk1 (type: bigint), d_moy1 (type: int), mean1 (type: double), cov1 (type: double) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query4.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query4.q.out new file mode 100644 index 000000000000..b3aedde5ca59 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query4.q.out @@ -0,0 +1,104 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "t69"."customer_id", "t69"."customer_first_name", "t69"."customer_last_name", "t69"."customer_birth_country" +FROM (SELECT "t67"."customer_id", "t67"."customer_first_name", "t67"."customer_last_name", "t67"."customer_birth_country" +FROM (SELECT "t1"."c_customer_id" AS "customer_id", SUM("t4"."$f8") AS "year_total", SUM("t4"."$f8") > 0 AS "EXPR$131" +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 (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 "customer") AS "t" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t1" +INNER JOIN ((SELECT "ss_sold_date_sk", "ss_customer_sk", ("ss_ext_list_price" - "ss_ext_wholesale_cost" - "ss_ext_discount_amt" + "ss_ext_sales_price") / 2 AS "$f8" +FROM (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 "store_sales") AS "t2" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t4" INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t5" +WHERE "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t7" ON "t4"."ss_sold_date_sk" = "t7"."d_date_sk") ON "t1"."c_customer_sk" = "t4"."ss_customer_sk" +GROUP BY "t1"."c_customer_id", "t1"."c_first_name", "t1"."c_last_name", "t1"."c_preferred_cust_flag", "t1"."c_birth_country", "t1"."c_login", "t1"."c_email_address" +HAVING SUM("t4"."$f8") > 0) AS "t10" +INNER JOIN (SELECT "t13"."c_customer_id" AS "customer_id", SUM("t16"."$f8") AS "year_total" +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 (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 "customer") AS "t11" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t13" +INNER JOIN ((SELECT "cs_sold_date_sk", "cs_bill_customer_sk", ("cs_ext_list_price" - "cs_ext_wholesale_cost" - "cs_ext_discount_amt" + "cs_ext_sales_price") / 2 AS "$f8" +FROM (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 "catalog_sales") AS "t14" +WHERE "cs_bill_customer_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t16" INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t17" +WHERE "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t19" ON "t16"."cs_sold_date_sk" = "t19"."d_date_sk") ON "t13"."c_customer_sk" = "t16"."cs_bill_customer_sk" +GROUP BY "t13"."c_customer_id", "t13"."c_first_name", "t13"."c_last_name", "t13"."c_preferred_cust_flag", "t13"."c_birth_country", "t13"."c_login", "t13"."c_email_address") AS "t21" ON "t10"."customer_id" = "t21"."customer_id" +INNER JOIN (SELECT "t24"."c_customer_id" AS "customer_id", SUM("t27"."$f8") AS "year_total" +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 (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 "customer") AS "t22" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t24" +INNER JOIN ((SELECT "ws_sold_date_sk", "ws_bill_customer_sk", ("ws_ext_list_price" - "ws_ext_wholesale_cost" - "ws_ext_discount_amt" + "ws_ext_sales_price") / 2 AS "$f8" +FROM (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 "web_sales") AS "t25" +WHERE "ws_bill_customer_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t27" INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t28" +WHERE "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t30" ON "t27"."ws_sold_date_sk" = "t30"."d_date_sk") ON "t24"."c_customer_sk" = "t27"."ws_bill_customer_sk" +GROUP BY "t24"."c_customer_id", "t24"."c_first_name", "t24"."c_last_name", "t24"."c_preferred_cust_flag", "t24"."c_birth_country", "t24"."c_login", "t24"."c_email_address") AS "t32" ON "t10"."customer_id" = "t32"."customer_id" +INNER JOIN (SELECT "t35"."c_customer_id" AS "customer_id", SUM("t38"."$f8") AS "year_total", SUM("t38"."$f8") > 0 AS "EXPR$1" +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 (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 "customer") AS "t33" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t35" +INNER JOIN ((SELECT "cs_sold_date_sk", "cs_bill_customer_sk", ("cs_ext_list_price" - "cs_ext_wholesale_cost" - "cs_ext_discount_amt" + "cs_ext_sales_price") / 2 AS "$f8" +FROM (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 "catalog_sales") AS "t36" +WHERE "cs_bill_customer_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t38" INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t39" +WHERE "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t41" ON "t38"."cs_sold_date_sk" = "t41"."d_date_sk") ON "t35"."c_customer_sk" = "t38"."cs_bill_customer_sk" +GROUP BY "t35"."c_customer_id", "t35"."c_first_name", "t35"."c_last_name", "t35"."c_preferred_cust_flag", "t35"."c_birth_country", "t35"."c_login", "t35"."c_email_address" +HAVING SUM("t38"."$f8") > 0) AS "t44" ON "t10"."customer_id" = "t44"."customer_id" +INNER JOIN (SELECT "t47"."c_customer_id" AS "customer_id", SUM("t50"."$f8") AS "year_total", SUM("t50"."$f8") > 0 AS "EXPR$0" +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 (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 "customer") AS "t45" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t47" +INNER JOIN ((SELECT "ws_sold_date_sk", "ws_bill_customer_sk", ("ws_ext_list_price" - "ws_ext_wholesale_cost" - "ws_ext_discount_amt" + "ws_ext_sales_price") / 2 AS "$f8" +FROM (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 "web_sales") AS "t48" +WHERE "ws_bill_customer_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t50" INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t51" +WHERE "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t53" ON "t50"."ws_sold_date_sk" = "t53"."d_date_sk") ON "t47"."c_customer_sk" = "t50"."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("t50"."$f8") > 0) AS "t56" ON "t10"."customer_id" = "t56"."customer_id" AND CASE WHEN "t56"."EXPR$0" THEN CASE WHEN "t44"."EXPR$1" THEN "t21"."year_total" / "t44"."year_total" > "t32"."year_total" / "t56"."year_total" ELSE FALSE END ELSE FALSE END +INNER JOIN (SELECT "t59"."c_customer_id" AS "customer_id", "t59"."c_first_name" AS "customer_first_name", "t59"."c_last_name" AS "customer_last_name", "t59"."c_birth_country" AS "customer_birth_country", SUM("t62"."$f8") AS "year_total" +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 (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 "customer") AS "t57" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t59" +INNER JOIN ((SELECT "ss_sold_date_sk", "ss_customer_sk", ("ss_ext_list_price" - "ss_ext_wholesale_cost" - "ss_ext_discount_amt" + "ss_ext_sales_price") / 2 AS "$f8" +FROM (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 "store_sales") AS "t60" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t62" INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t63" +WHERE "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t65" ON "t62"."ss_sold_date_sk" = "t65"."d_date_sk") ON "t59"."c_customer_sk" = "t62"."ss_customer_sk" +GROUP BY "t59"."c_customer_id", "t59"."c_first_name", "t59"."c_last_name", "t59"."c_preferred_cust_flag", "t59"."c_birth_country", "t59"."c_login", "t59"."c_email_address") AS "t67" ON "t10"."customer_id" = "t67"."customer_id" AND CASE WHEN "t10"."EXPR$131" THEN CASE WHEN "t44"."EXPR$1" THEN "t21"."year_total" / "t44"."year_total" > "t67"."year_total" / "t10"."year_total" ELSE FALSE END ELSE FALSE END +ORDER BY "t67"."customer_id", "t67"."customer_first_name", "t67"."customer_last_name", "t67"."customer_birth_country" +FETCH NEXT 100 ROWS ONLY) AS "t69" + hive.sql.query.fieldNames customer_id,customer_first_name,customer_last_name,customer_birth_country + hive.sql.query.fieldTypes string,string,string,string + hive.sql.query.split false + Select Operator + expressions: customer_id (type: string), customer_first_name (type: string), customer_last_name (type: string), customer_birth_country (type: string) + outputColumnNames: _col0, _col1, _col2, _col3 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query40.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query40.q.out new file mode 100644 index 000000000000..ad1ef6232d3b --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query40.q.out @@ -0,0 +1,44 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t16"."$f0", "t16"."$f1", "t16"."$f2", "t16"."$f3" +FROM (SELECT "t7"."w_state" AS "$f0", "t10"."i_item_id" AS "$f1", SUM(CASE WHEN "t13"."EXPR$0" THEN "t1"."cs_sales_price" - CASE WHEN "t4"."cr_refunded_cash" IS NOT NULL THEN "t4"."cr_refunded_cash" ELSE 0 END ELSE 0 END) AS "$f2", SUM(CASE WHEN "t13"."EXPR$1" THEN "t1"."cs_sales_price" - CASE WHEN "t4"."cr_refunded_cash" IS NOT NULL THEN "t4"."cr_refunded_cash" ELSE 0 END ELSE 0 END) AS "$f3" +FROM (SELECT "cs_sold_date_sk", "cs_warehouse_sk", "cs_item_sk", "cs_order_number", "cs_sales_price" +FROM (SELECT "cs_sold_date_sk", "cs_warehouse_sk", "cs_item_sk", "cs_order_number", "cs_sales_price" +FROM "catalog_sales") AS "t" +WHERE "cs_warehouse_sk" IS NOT NULL AND "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t1" +LEFT JOIN (SELECT "cr_item_sk", "cr_order_number", "cr_refunded_cash" +FROM (SELECT "cr_item_sk", "cr_order_number", "cr_refunded_cash" +FROM "catalog_returns") AS "t2" +WHERE "cr_order_number" IS NOT NULL AND "cr_item_sk" IS NOT NULL) AS "t4" ON "t1"."cs_order_number" = "t4"."cr_order_number" AND "t1"."cs_item_sk" = "t4"."cr_item_sk" +INNER JOIN (SELECT "w_warehouse_sk", "w_state" +FROM (SELECT "w_warehouse_sk", "w_state" +FROM "warehouse") AS "t5" +WHERE "w_warehouse_sk" IS NOT NULL) AS "t7" ON "t1"."cs_warehouse_sk" = "t7"."w_warehouse_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id", "i_current_price" +FROM "item") AS "t8" +WHERE "i_current_price" BETWEEN 0.99 AND 1.49 AND "i_item_sk" IS NOT NULL) AS "t10" ON "t1"."cs_item_sk" = "t10"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_date" < DATE '1998-04-08' AS "EXPR$0", "d_date" >= DATE '1998-04-08' AS "EXPR$1" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t11" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '1998-03-09 00:00:00.000000000' AND TIMESTAMP '1998-05-08 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t13" ON "t1"."cs_sold_date_sk" = "t13"."d_date_sk" +GROUP BY "t7"."w_state", "t10"."i_item_id" +ORDER BY "t7"."w_state", "t10"."i_item_id" +FETCH NEXT 100 ROWS ONLY) AS "t16" + hive.sql.query.fieldNames $f0,$f1,$f2,$f3 + hive.sql.query.fieldTypes string,string,decimal(23,2),decimal(23,2) + hive.sql.query.split false + Select Operator + expressions: $f0 (type: string), $f1 (type: string), $f2 (type: decimal(23,2)), $f3 (type: decimal(23,2)) + outputColumnNames: _col0, _col1, _col2, _col3 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query41.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query41.q.out new file mode 100644 index 000000000000..2bc97d9c6a54 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query41.q.out @@ -0,0 +1,34 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: i1 + properties: + hive.sql.query SELECT "t8"."i_product_name" +FROM (SELECT "t1"."i_product_name" +FROM (SELECT "i_manufact", "i_product_name" +FROM (SELECT "i_manufact_id", "i_manufact", "i_product_name" +FROM "item") AS "t" +WHERE "i_manufact_id" BETWEEN 970 AND 1010 AND "i_manufact" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "i_manufact" +FROM (SELECT "i_category", "i_manufact", "i_size", "i_color", "i_units" +FROM "item") AS "t2" +WHERE ("i_category" = 'Women' AND "i_color" IN ('frosted', 'rose') AND "i_units" IN ('Gross', 'Lb') AND "i_size" IN ('large', 'medium') OR "i_category" = 'Women' AND "i_color" IN ('black', 'chocolate') AND "i_units" IN ('Box', 'Dram') AND "i_size" IN ('economy', 'petite') OR ("i_category" = 'Men' AND "i_color" IN ('magenta', 'slate') AND "i_units" IN ('Bundle', 'Carton') AND "i_size" IN ('N/A', 'small') OR "i_category" = 'Men' AND "i_color" IN ('cornflower', 'firebrick') AND "i_units" IN ('Oz', 'Pound') AND "i_size" IN ('large', 'medium')) OR ("i_category" = 'Women' AND "i_color" IN ('almond', 'steel') AND "i_units" IN ('Case', 'Tsp') AND "i_size" IN ('large', 'medium') OR "i_category" = 'Women' AND "i_color" IN ('aquamarine', 'purple') AND "i_units" IN ('Bunch', 'Gram') AND "i_size" IN ('economy', 'petite') OR ("i_category" = 'Men' AND "i_color" IN ('lavender', 'papaya') AND "i_units" IN ('Cup', 'Pallet') AND "i_size" IN ('N/A', 'small') OR "i_category" = 'Men' AND "i_color" IN ('cyan', 'maroon') AND "i_units" IN ('Each', 'N/A') AND "i_size" IN ('large', 'medium')))) AND ("i_category" IN ('Men', 'Women') AND "i_size" IN ('N/A', 'economy', 'large', 'medium', 'petite', 'small')) AND ("i_color" IN ('almond', 'aquamarine', 'black', 'chocolate', 'cornflower', 'cyan', 'firebrick', 'frosted', 'lavender', 'magenta', 'maroon', 'papaya', 'purple', 'rose', 'slate', 'steel') AND ("i_units" IN ('Box', 'Bunch', 'Bundle', 'Carton', 'Case', 'Cup', 'Dram', 'Each', 'Gram', 'Gross', 'Lb', 'N/A', 'Oz', 'Pallet', 'Pound', 'Tsp') AND "i_manufact" IS NOT NULL)) +GROUP BY "i_manufact" +HAVING COUNT(*) > 0) AS "t6" ON "t1"."i_manufact" = "t6"."i_manufact" +GROUP BY "t1"."i_product_name" +ORDER BY "t1"."i_product_name" +FETCH NEXT 100 ROWS ONLY) AS "t8" + hive.sql.query.fieldNames i_product_name + hive.sql.query.fieldTypes string + hive.sql.query.split false + Select Operator + expressions: i_product_name (type: string) + outputColumnNames: _col0 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query42.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query42.q.out new file mode 100644 index 000000000000..2d647fc9af3b --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query42.q.out @@ -0,0 +1,36 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(1998 AS INTEGER) AS "d_year", "t10"."i_category_id", "t10"."i_category", "t10"."_o__c3" +FROM (SELECT "t7"."i_category_id", "t7"."i_category", SUM("t1"."ss_ext_sales_price") AS "_o__c3", SUM("t1"."ss_ext_sales_price") AS "(tok_function sum (tok_table_or_col ss_ext_sales_price))" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_moy" = 12 AND "d_year" = 1998 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "i_item_sk", "i_category_id", "i_category" +FROM (SELECT "i_item_sk", "i_category_id", "i_category", "i_manager_id" +FROM "item") AS "t5" +WHERE "i_manager_id" = 1 AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" +GROUP BY "t7"."i_category_id", "t7"."i_category" +ORDER BY SUM("t1"."ss_ext_sales_price") DESC, "t7"."i_category_id", "t7"."i_category" +FETCH NEXT 100 ROWS ONLY) AS "t10" + hive.sql.query.fieldNames d_year,i_category_id,i_category,_o__c3 + hive.sql.query.fieldTypes int,int,string,decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: d_year (type: int), i_category_id (type: int), i_category (type: string), _o__c3 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query43.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query43.q.out new file mode 100644 index 000000000000..62ab774deef0 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query43.q.out @@ -0,0 +1,36 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t10"."$f0", "t10"."$f1", "t10"."$f2", "t10"."$f3", "t10"."$f4", "t10"."$f5", "t10"."$f6", "t10"."$f7", "t10"."$f8" +FROM (SELECT "t4"."s_store_name" AS "$f0", "t4"."s_store_id" AS "$f1", SUM(CASE WHEN "t7"."EXPR$0" THEN "t1"."ss_sales_price" ELSE NULL END) AS "$f2", SUM(CASE WHEN "t7"."EXPR$1" THEN "t1"."ss_sales_price" ELSE NULL END) AS "$f3", SUM(CASE WHEN "t7"."EXPR$2" THEN "t1"."ss_sales_price" ELSE NULL END) AS "$f4", SUM(CASE WHEN "t7"."EXPR$3" THEN "t1"."ss_sales_price" ELSE NULL END) AS "$f5", SUM(CASE WHEN "t7"."EXPR$4" THEN "t1"."ss_sales_price" ELSE NULL END) AS "$f6", SUM(CASE WHEN "t7"."EXPR$5" THEN "t1"."ss_sales_price" ELSE NULL END) AS "$f7", SUM(CASE WHEN "t7"."EXPR$6" THEN "t1"."ss_sales_price" ELSE NULL END) AS "$f8" +FROM (SELECT "ss_sold_date_sk", "ss_store_sk", "ss_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_store_sk", "ss_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "s_store_sk", "s_store_id", "s_store_name" +FROM (SELECT "s_store_sk", "s_store_id", "s_store_name", "s_gmt_offset" +FROM "store") AS "t2" +WHERE "s_gmt_offset" = -6 AND "s_store_sk" IS NOT NULL) AS "t4" ON "t1"."ss_store_sk" = "t4"."s_store_sk" +INNER JOIN (SELECT "d_date_sk", "d_day_name" = 'Sunday' AS "EXPR$0", "d_day_name" = 'Monday' AS "EXPR$1", "d_day_name" = 'Tuesday' AS "EXPR$2", "d_day_name" = 'Wednesday' AS "EXPR$3", "d_day_name" = 'Thursday' AS "EXPR$4", "d_day_name" = 'Friday' AS "EXPR$5", "d_day_name" = 'Saturday' AS "EXPR$6" +FROM (SELECT "d_date_sk", "d_year", "d_day_name" +FROM "date_dim") AS "t5" +WHERE "d_year" = 1998 AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_date_sk" = "t7"."d_date_sk" +GROUP BY "t4"."s_store_name", "t4"."s_store_id" +ORDER BY "t4"."s_store_name", "t4"."s_store_id", SUM(CASE WHEN "t7"."EXPR$0" THEN "t1"."ss_sales_price" ELSE NULL END), SUM(CASE WHEN "t7"."EXPR$1" THEN "t1"."ss_sales_price" ELSE NULL END), SUM(CASE WHEN "t7"."EXPR$2" THEN "t1"."ss_sales_price" ELSE NULL END), SUM(CASE WHEN "t7"."EXPR$3" THEN "t1"."ss_sales_price" ELSE NULL END), SUM(CASE WHEN "t7"."EXPR$4" THEN "t1"."ss_sales_price" ELSE NULL END), SUM(CASE WHEN "t7"."EXPR$5" THEN "t1"."ss_sales_price" ELSE NULL END), SUM(CASE WHEN "t7"."EXPR$6" THEN "t1"."ss_sales_price" ELSE NULL END) +FETCH NEXT 100 ROWS ONLY) AS "t10" + hive.sql.query.fieldNames $f0,$f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8 + hive.sql.query.fieldTypes string,string,decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: $f0 (type: string), $f1 (type: string), $f2 (type: decimal(17,2)), $f3 (type: decimal(17,2)), $f4 (type: decimal(17,2)), $f5 (type: decimal(17,2)), $f6 (type: decimal(17,2)), $f7 (type: decimal(17,2)), $f8 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query44.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query44.q.out new file mode 100644 index 000000000000..824f51fe7d74 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query44.q.out @@ -0,0 +1,281 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Map 1 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE) + Reducer 7 <- Map 6 (SIMPLE_EDGE) + Reducer 8 <- Map 6 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: i1 + properties: + hive.sql.query SELECT "i_item_sk", "i_product_name" +FROM (SELECT "i_item_sk", "i_product_name" +FROM "item") AS "t" +WHERE "i_item_sk" IS NOT NULL + hive.sql.query.fieldNames i_item_sk,i_product_name + hive.sql.query.fieldTypes bigint,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_sk (type: bigint), i_product_name (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: ss1 + properties: + hive.sql.query SELECT "t3"."$f0", "t3"."$f1", "t10"."rank_col" +FROM (SELECT "ss_item_sk" AS "$f0", CAST(SUM("ss_net_profit") / COUNT("ss_net_profit") AS DECIMAL(11, 6)) AS "$f1" +FROM (SELECT "ss_item_sk", "ss_store_sk", "ss_net_profit" +FROM "store_sales") AS "t" +WHERE "ss_store_sk" = 410 +GROUP BY "ss_item_sk" +HAVING CAST(SUM("ss_net_profit") / COUNT("ss_net_profit") AS DECIMAL(11, 6)) IS NOT NULL) AS "t3" +INNER JOIN (SELECT CAST(SUM("t5"."ss_net_profit") / COUNT("t5"."ss_net_profit") AS DECIMAL(11, 6)) AS "rank_col" +FROM (SELECT * +FROM (SELECT "ss_hdemo_sk", "ss_store_sk", "ss_net_profit" +FROM "store_sales") AS "t4" +WHERE "ss_store_sk" = 410 AND "ss_hdemo_sk" IS NULL) AS "t5", +(VALUES (TRUE)) AS "t6" ("$f0") +GROUP BY "t6"."$f0" +HAVING CAST(SUM("t5"."ss_net_profit") / COUNT("t5"."ss_net_profit") AS DECIMAL(11, 6)) IS NOT NULL) AS "t10" ON "t3"."$f1" > 0.9 * "t10"."rank_col" + hive.sql.query.fieldNames $f0,$f1,rank_col + hive.sql.query.fieldTypes bigint,decimal(11,6),decimal(11,6) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: - + keys: $f1 (type: decimal(11,6)) + null sort order: a + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + top n: 11 + Select Operator + expressions: $f0 (type: bigint), $f1 (type: decimal(11,6)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: 0 (type: int), _col1 (type: decimal(11,6)) + null sort order: aa + sort order: +- + Map-reduce partition columns: 0 (type: int) + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Top N Key Operator + sort order: + + keys: $f1 (type: decimal(11,6)) + null sort order: z + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + top n: 11 + Select Operator + expressions: $f0 (type: bigint), $f1 (type: decimal(11,6)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: 0 (type: int), _col1 (type: decimal(11,6)) + null sort order: az + sort order: ++ + Map-reduce partition columns: 0 (type: int) + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col1, _col3 + Statistics: Num rows: 1 Data size: 211 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col3 (type: int) + Statistics: Num rows: 1 Data size: 211 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col3 (type: int) + 1 _col1 (type: int) + outputColumnNames: _col1, _col3, _col7 + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: + + keys: _col3 (type: int) + null sort order: z + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col3 (type: int), _col1 (type: string), _col7 (type: string) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string), _col2 (type: string) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: int), VALUE._col0 (type: string), VALUE._col1 (type: string) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 5 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col1, _col3 + Statistics: Num rows: 1 Data size: 132 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 132 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: string) + Reducer 7 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: bigint), KEY.reducesinkkey1 (type: decimal(11,6)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: bigint, _col1: decimal(11,6) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col1 DESC NULLS FIRST + partition by: 0 + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: _col1 + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: ((rank_window_0 < 11) and _col0 is not null) (type: boolean) + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: bigint), rank_window_0 (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int) + Reducer 8 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: bigint), KEY.reducesinkkey1 (type: decimal(11,6)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: bigint, _col1: decimal(11,6) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col1 ASC NULLS LAST + partition by: 0 + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: _col1 + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: ((rank_window_0 < 11) and _col0 is not null) (type: boolean) + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: bigint), rank_window_0 (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int) + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query45.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query45.q.out new file mode 100644 index 000000000000..6ec389ffb3a4 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query45.q.out @@ -0,0 +1,249 @@ +Warning: Shuffle Join MERGEJOIN[42][tables = [$hdt$_1, $hdt$_2]] in Stage 'Reducer 2' is a cross product +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (XPROD_EDGE), Map 7 (XPROD_EDGE) + Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Map 9 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: item + properties: + hive.sql.query SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t" +WHERE "i_item_sk" IS NOT NULL + hive.sql.query.fieldNames i_item_sk,i_item_id + hive.sql.query.fieldTypes bigint,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_sk (type: bigint), i_item_id (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: item + properties: + hive.sql.query SELECT COUNT(*) AS "c" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t" +WHERE "i_item_sk" IN (2, 3, 5, 7, 11, 13, 17, 19, 23, 29) + hive.sql.query.fieldNames c + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 8 + Map Operator Tree: + TableScan + alias: item + properties: + hive.sql.query SELECT "i_item_id", TRUE AS "literalTrue" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t" +WHERE "i_item_sk" IN (2, 3, 5, 7, 11, 13, 17, 19, 23, 29) AND "i_item_id" IS NOT NULL +GROUP BY "i_item_id" + hive.sql.query.fieldNames i_item_id,literalTrue + hive.sql.query.fieldTypes string,boolean + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_id (type: string), literaltrue (type: boolean) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t1"."ws_sold_date_sk", "t1"."ws_item_sk", "t1"."ws_bill_customer_sk", "t1"."ws_sales_price", "t4"."d_date_sk", "t4"."d_year", "t4"."d_qoy", "t11"."ca_address_sk", "t11"."ca_county", "t11"."ca_zip", "t11"."c_customer_sk", "t11"."c_current_addr_sk" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_customer_sk", "ws_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_customer_sk", "ws_sales_price" +FROM "web_sales") AS "t" +WHERE "ws_bill_customer_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL AND "ws_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_qoy" +FROM (SELECT "d_date_sk", "d_year", "d_qoy" +FROM "date_dim") AS "t2" +WHERE "d_qoy" = 2 AND "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "t7"."ca_address_sk", "t7"."ca_county", "t7"."ca_zip", "t10"."c_customer_sk", "t10"."c_current_addr_sk" +FROM (SELECT "ca_address_sk", "ca_county", "ca_zip" +FROM (SELECT "ca_address_sk", "ca_county", "ca_zip" +FROM "customer_address") AS "t5" +WHERE "ca_address_sk" IS NOT NULL) AS "t7" +INNER JOIN (SELECT "c_customer_sk", "c_current_addr_sk" +FROM (SELECT "c_customer_sk", "c_current_addr_sk" +FROM "customer") AS "t8" +WHERE "c_customer_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL) AS "t10" ON "t7"."ca_address_sk" = "t10"."c_current_addr_sk") AS "t11" ON "t1"."ws_bill_customer_sk" = "t11"."c_customer_sk" + hive.sql.query.fieldNames ws_sold_date_sk,ws_item_sk,ws_bill_customer_sk,ws_sales_price,d_date_sk,d_year,d_qoy,ca_address_sk,ca_county,ca_zip,c_customer_sk,c_current_addr_sk + hive.sql.query.fieldTypes int,bigint,int,decimal(7,2),int,int,int,int,string,string,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 488 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_item_sk (type: bigint), ws_sales_price (type: decimal(7,2)), ca_county (type: string), ca_zip (type: string) + outputColumnNames: _col1, _col3, _col8, _col9 + Statistics: Num rows: 1 Data size: 488 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: bigint) + Statistics: Num rows: 1 Data size: 488 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)), _col8 (type: string), _col9 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 201 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: string) + Statistics: Num rows: 1 Data size: 201 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col2 (type: bigint) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 _col1 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col0, _col2, _col4 + Statistics: Num rows: 1 Data size: 221 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 221 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: bigint), _col4 (type: boolean) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: bigint) + 1 _col1 (type: bigint) + outputColumnNames: _col2, _col4, _col8, _col13, _col14 + Statistics: Num rows: 1 Data size: 243 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col8 (type: decimal(7,2)), _col13 (type: string), _col14 (type: string), _col2 (type: bigint), _col4 (type: boolean) + outputColumnNames: _col3, _col7, _col8, _col14, _col16 + Statistics: Num rows: 1 Data size: 243 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (((_col14 <> 0L) and _col16 is not null) or (substr(_col8, 1, 5)) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792')) (type: boolean) + Statistics: Num rows: 1 Data size: 243 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col8 (type: string), _col7 (type: string) + null sort order: zz + Statistics: Num rows: 1 Data size: 243 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col3 (type: decimal(7,2)), _col7 (type: string), _col8 (type: string) + outputColumnNames: _col3, _col7, _col8 + Statistics: Num rows: 1 Data size: 243 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3) + keys: _col8 (type: string), _col7 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 243 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string) + Statistics: Num rows: 1 Data size: 243 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(17,2)) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string), KEY._col1 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 243 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string) + null sort order: zz + sort order: ++ + Statistics: Num rows: 1 Data size: 243 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(17,2)) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), VALUE._col0 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 243 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 243 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 243 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query46.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query46.q.out new file mode 100644 index 000000000000..1472e2720836 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query46.q.out @@ -0,0 +1,53 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "t23"."c_last_name", "t23"."c_first_name", "t23"."ca_city", "t23"."bought_city", "t23"."ss_ticket_number", "t23"."amt", "t23"."profit" +FROM (SELECT "t1"."c_last_name", "t1"."c_first_name", "t4"."ca_city", "t21"."bought_city", "t21"."ss_ticket_number", "t21"."amt", "t21"."profit" +FROM (SELECT "c_customer_sk", "c_current_addr_sk", "c_first_name", "c_last_name" +FROM (SELECT "c_customer_sk", "c_current_addr_sk", "c_first_name", "c_last_name" +FROM "customer") AS "t" +WHERE "c_customer_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_city" +FROM (SELECT "ca_address_sk", "ca_city" +FROM "customer_address") AS "t2" +WHERE "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."c_current_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "t7"."ss_ticket_number", "t7"."ss_customer_sk", "t19"."ca_city" AS "bought_city", SUM("t7"."ss_coupon_amt") AS "amt", SUM("t7"."ss_net_profit") AS "profit" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_hdemo_sk", "ss_addr_sk", "ss_store_sk", "ss_ticket_number", "ss_coupon_amt", "ss_net_profit" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_hdemo_sk", "ss_addr_sk", "ss_store_sk", "ss_ticket_number", "ss_coupon_amt", "ss_net_profit" +FROM "store_sales") AS "t5" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL AND "ss_hdemo_sk" IS NOT NULL AND "ss_addr_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL) AS "t7" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_dow" +FROM "date_dim") AS "t8" +WHERE "d_dow" IN (0, 6) AND "d_year" IN (1998, 1999, 2000) AND "d_date_sk" IS NOT NULL) AS "t10" ON "t7"."ss_sold_date_sk" = "t10"."d_date_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_city" +FROM "store") AS "t11" +WHERE "s_city" IN ('Cedar Grove', 'Highland Park', 'Salem', 'Union', 'Wildwood') AND "s_store_sk" IS NOT NULL) AS "t13" ON "t7"."ss_store_sk" = "t13"."s_store_sk" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t14" +WHERE ("hd_dep_count" = 2 OR "hd_vehicle_count" = 1) AND "hd_demo_sk" IS NOT NULL) AS "t16" ON "t7"."ss_hdemo_sk" = "t16"."hd_demo_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_city" +FROM (SELECT "ca_address_sk", "ca_city" +FROM "customer_address") AS "t17" +WHERE "ca_address_sk" IS NOT NULL) AS "t19" ON "t7"."ss_addr_sk" = "t19"."ca_address_sk" +GROUP BY "t7"."ss_customer_sk", "t7"."ss_addr_sk", "t7"."ss_ticket_number", "t19"."ca_city") AS "t21" ON "t4"."ca_city" <> "t21"."bought_city" AND "t1"."c_customer_sk" = "t21"."ss_customer_sk" +ORDER BY "t1"."c_last_name", "t1"."c_first_name", "t4"."ca_city", "t21"."bought_city", "t21"."ss_ticket_number" +FETCH NEXT 100 ROWS ONLY) AS "t23" + hive.sql.query.fieldNames c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,amt,profit + hive.sql.query.fieldTypes string,string,string,string,bigint,decimal(17,2),decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: c_last_name (type: string), c_first_name (type: string), ca_city (type: string), bought_city (type: string), ss_ticket_number (type: bigint), amt (type: decimal(17,2)), profit (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query47.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query47.q.out new file mode 100644 index 000000000000..40c388c2c8da --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query47.q.out @@ -0,0 +1,297 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) + Reducer 7 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t4"."i_brand", "t4"."i_category", "t7"."d_year", "t7"."d_moy", "t10"."s_store_name", "t10"."s_company_name", SUM("t1"."ss_sales_price") AS "$f6" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_item_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "i_item_sk", "i_brand", "i_category" +FROM (SELECT "i_item_sk", "i_brand", "i_category" +FROM "item") AS "t2" +WHERE "i_item_sk" IS NOT NULL AND "i_category" IS NOT NULL AND "i_brand" IS NOT NULL) AS "t4" ON "t1"."ss_item_sk" = "t4"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t5" +WHERE ("d_year" = 2000 OR "d_year" = 1999 AND "d_moy" = 12 OR "d_year" = 2001 AND "d_moy" = 1) AND "d_year" IN (1999, 2000, 2001) AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_date_sk" = "t7"."d_date_sk" +INNER JOIN (SELECT "s_store_sk", "s_store_name", "s_company_name" +FROM (SELECT "s_store_sk", "s_store_name", "s_company_name" +FROM "store") AS "t8" +WHERE "s_store_sk" IS NOT NULL AND "s_store_name" IS NOT NULL AND "s_company_name" IS NOT NULL) AS "t10" ON "t1"."ss_store_sk" = "t10"."s_store_sk" +GROUP BY "t4"."i_brand", "t4"."i_category", "t7"."d_year", "t7"."d_moy", "t10"."s_store_name", "t10"."s_company_name" + hive.sql.query.fieldNames i_brand,i_category,d_year,d_moy,s_store_name,s_company_name,$f6 + hive.sql.query.fieldTypes string,string,int,int,string,string,decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_brand (type: string), i_category (type: string), d_year (type: int), d_moy (type: int), s_store_name (type: string), s_company_name (type: string), $f6 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: string), _col0 (type: string), _col4 (type: string), _col5 (type: string), _col2 (type: int) + null sort order: aaaaa + sort order: +++++ + Map-reduce partition columns: _col1 (type: string), _col0 (type: string), _col4 (type: string), _col5 (type: string), _col2 (type: int) + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: int), _col6 (type: decimal(17,2)) + Reduce Output Operator + key expressions: _col1 (type: string), _col0 (type: string), _col4 (type: string), _col5 (type: string), _col2 (type: int), _col3 (type: int) + null sort order: aaaazz + sort order: ++++++ + Map-reduce partition columns: _col1 (type: string), _col0 (type: string), _col4 (type: string), _col5 (type: string) + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + value expressions: _col6 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey1 (type: string), KEY.reducesinkkey0 (type: string), KEY.reducesinkkey4 (type: int), VALUE._col0 (type: int), KEY.reducesinkkey2 (type: string), KEY.reducesinkkey3 (type: string), VALUE._col1 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: string, _col2: int, _col3: int, _col4: string, _col5: string, _col6: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col1 ASC NULLS FIRST, _col0 ASC NULLS FIRST, _col4 ASC NULLS FIRST, _col5 ASC NULLS FIRST, _col2 ASC NULLS FIRST + partition by: _col1, _col0, _col4, _col5, _col2 + raw input shape: + window functions: + window function definition + alias: avg_window_0 + arguments: _col6 + name: avg + window function: GenericUDAFAverageEvaluatorDecimal + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: avg_window_0 (type: decimal(21,6)), _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string), _col5 (type: string), _col6 (type: decimal(17,2)) + outputColumnNames: avg_window_0, _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: string), _col0 (type: string), _col4 (type: string), _col5 (type: string), _col2 (type: int), _col3 (type: int) + null sort order: aaaazz + sort order: ++++++ + Map-reduce partition columns: _col1 (type: string), _col0 (type: string), _col4 (type: string), _col5 (type: string) + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + value expressions: avg_window_0 (type: decimal(21,6)), _col6 (type: decimal(17,2)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: decimal(21,6)), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey0 (type: string), KEY.reducesinkkey4 (type: int), KEY.reducesinkkey5 (type: int), KEY.reducesinkkey2 (type: string), KEY.reducesinkkey3 (type: string), VALUE._col1 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: decimal(21,6), _col1: string, _col2: string, _col3: int, _col4: int, _col5: string, _col6: string, _col7: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col3 ASC NULLS LAST, _col4 ASC NULLS LAST + partition by: _col2, _col1, _col5, _col6 + raw input shape: + window functions: + window function definition + alias: rank_window_1 + arguments: _col3, _col4 + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: ((_col0 > 0) and rank_window_1 is not null and (_col3 = 2000)) (type: boolean) + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: rank_window_1 (type: int), _col0 (type: decimal(21,6)), _col1 (type: string), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: string), _col6 (type: string), _col7 (type: decimal(17,2)) + outputColumnNames: rank_window_1, _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: if((_col0 > 0), ((abs((_col7 - _col0)) / _col0) > 0.1), false) (type: boolean) + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col2 (type: string), _col1 (type: string), _col5 (type: string), _col6 (type: string), _col3 (type: int), _col4 (type: int), _col7 (type: decimal(17,2)), _col0 (type: decimal(21,6)), rank_window_1 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col8 (type: int) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col8 (type: int) + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: int), _col5 (type: int), _col6 (type: decimal(17,2)), _col7 (type: decimal(21,6)) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col8 (type: int) + 1 _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col5 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col13 + Statistics: Num rows: 1 Data size: 941 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col8 (type: int) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col8 (type: int) + Statistics: Num rows: 1 Data size: 941 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: int), _col5 (type: int), _col6 (type: decimal(17,2)), _col7 (type: decimal(21,6)), _col13 (type: decimal(17,2)) + Reducer 5 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col8 (type: int) + 1 _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col5 (type: int) + outputColumnNames: _col0, _col4, _col5, _col6, _col7, _col13, _col19 + Statistics: Num rows: 1 Data size: 1035 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: (_col6 - _col7) (type: decimal(22,6)), _col5 (type: int) + null sort order: zz + Statistics: Num rows: 1 Data size: 1035 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col0 (type: string), _col4 (type: int), _col5 (type: int), _col7 (type: decimal(21,6)), _col6 (type: decimal(17,2)), _col13 (type: decimal(17,2)), _col19 (type: decimal(17,2)), (_col6 - _col7) (type: decimal(22,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 1035 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col7 (type: decimal(22,6)), _col2 (type: int) + null sort order: zz + sort order: ++ + Statistics: Num rows: 1 Data size: 1035 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col1 (type: int), _col3 (type: decimal(21,6)), _col4 (type: decimal(17,2)), _col5 (type: decimal(17,2)), _col6 (type: decimal(17,2)) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: string), VALUE._col1 (type: int), KEY.reducesinkkey1 (type: int), VALUE._col2 (type: decimal(21,6)), VALUE._col3 (type: decimal(17,2)), VALUE._col4 (type: decimal(17,2)), VALUE._col5 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 1035 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 1035 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 1035 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 7 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey1 (type: string), KEY.reducesinkkey0 (type: string), KEY.reducesinkkey4 (type: int), KEY.reducesinkkey5 (type: int), KEY.reducesinkkey2 (type: string), KEY.reducesinkkey3 (type: string), VALUE._col0 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: string, _col2: int, _col3: int, _col4: string, _col5: string, _col6: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col2 ASC NULLS LAST, _col3 ASC NULLS LAST + partition by: _col1, _col0, _col4, _col5 + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: _col2, _col3 + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: rank_window_0 is not null (type: boolean) + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col1 (type: string), _col0 (type: string), _col4 (type: string), _col5 (type: string), _col6 (type: decimal(17,2)), (rank_window_0 + 1) (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col5 (type: int) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col5 (type: int) + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: decimal(17,2)) + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: string, _col2: int, _col3: int, _col4: string, _col5: string, _col6: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col2 ASC NULLS LAST, _col3 ASC NULLS LAST + partition by: _col1, _col0, _col4, _col5 + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: _col2, _col3 + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: rank_window_0 is not null (type: boolean) + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col1 (type: string), _col0 (type: string), _col4 (type: string), _col5 (type: string), _col6 (type: decimal(17,2)), (rank_window_0 - 1) (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col5 (type: int) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col5 (type: int) + Statistics: Num rows: 1 Data size: 856 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: decimal(17,2)) + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query49.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query49.q.out new file mode 100644 index 000000000000..4fe30223b972 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query49.q.out @@ -0,0 +1,465 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 10 <- Map 9 (SIMPLE_EDGE) + Reducer 11 <- Reducer 10 (SIMPLE_EDGE), Union 4 (CONTAINS) + Reducer 13 <- Map 12 (SIMPLE_EDGE) + Reducer 14 <- Reducer 13 (SIMPLE_EDGE), Union 6 (CONTAINS) + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Union 4 (CONTAINS) + Reducer 5 <- Union 4 (SIMPLE_EDGE), Union 6 (CONTAINS) + Reducer 7 <- Union 6 (SIMPLE_EDGE) + Reducer 8 <- Reducer 7 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: ws + properties: + hive.sql.query SELECT "t1"."ws_item_sk", SUM("t7"."$f1") AS "$f1", SUM("t1"."$f2") AS "$f2", SUM("t7"."$f3") AS "$f3", SUM("t1"."$f4") AS "$f4" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_order_number", CASE WHEN "ws_quantity" IS NOT NULL THEN "ws_quantity" ELSE 0 END AS "$f2", CASE WHEN "ws_net_paid" IS NOT NULL THEN "ws_net_paid" ELSE 0 END AS "$f4" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_order_number", "ws_quantity", "ws_net_paid", "ws_net_profit" +FROM "web_sales") AS "t" +WHERE "ws_quantity" > 0 AND ("ws_net_profit" > 1 AND "ws_net_paid" > 0) AND ("ws_order_number" IS NOT NULL AND ("ws_item_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL))) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2000 AND "d_moy" = 12 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "wr_item_sk", "wr_order_number", CASE WHEN "wr_return_quantity" IS NOT NULL THEN "wr_return_quantity" ELSE 0 END AS "$f1", CASE WHEN "wr_return_amt" IS NOT NULL THEN "wr_return_amt" ELSE 0 END AS "$f3" +FROM (SELECT "wr_item_sk", "wr_order_number", "wr_return_quantity", "wr_return_amt" +FROM "web_returns") AS "t5" +WHERE "wr_return_amt" > 10000 AND "wr_order_number" IS NOT NULL AND "wr_item_sk" IS NOT NULL) AS "t7" ON "t1"."ws_order_number" = "t7"."wr_order_number" AND "t1"."ws_item_sk" = "t7"."wr_item_sk" +GROUP BY "t1"."ws_item_sk" + hive.sql.query.fieldNames ws_item_sk,$f1,$f2,$f3,$f4 + hive.sql.query.fieldTypes bigint,bigint,bigint,decimal(22,2),decimal(22,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_item_sk (type: bigint), $f1 (type: bigint), $f2 (type: bigint), $f3 (type: decimal(22,2)), $f4 (type: decimal(22,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: 0 (type: int), (CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) (type: decimal(35,20)) + null sort order: az + sort order: ++ + Map-reduce partition columns: 0 (type: int) + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(22,2)), _col4 (type: decimal(22,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 12 + Map Operator Tree: + TableScan + alias: sts + properties: + hive.sql.query SELECT "t1"."ss_item_sk", SUM("t7"."$f1") AS "$f1", SUM("t1"."$f2") AS "$f2", SUM("t7"."$f3") AS "$f3", SUM("t1"."$f4") AS "$f4" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ticket_number", CASE WHEN "ss_quantity" IS NOT NULL THEN "ss_quantity" ELSE 0 END AS "$f2", CASE WHEN "ss_net_paid" IS NOT NULL THEN "ss_net_paid" ELSE 0 END AS "$f4" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ticket_number", "ss_quantity", "ss_net_paid", "ss_net_profit" +FROM "store_sales") AS "t" +WHERE "ss_quantity" > 0 AND ("ss_net_profit" > 1 AND "ss_net_paid" > 0) AND ("ss_ticket_number" IS NOT NULL AND ("ss_item_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL))) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2000 AND "d_moy" = 12 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "sr_item_sk", "sr_ticket_number", CASE WHEN "sr_return_quantity" IS NOT NULL THEN "sr_return_quantity" ELSE 0 END AS "$f1", CASE WHEN "sr_return_amt" IS NOT NULL THEN "sr_return_amt" ELSE 0 END AS "$f3" +FROM (SELECT "sr_item_sk", "sr_ticket_number", "sr_return_quantity", "sr_return_amt" +FROM "store_returns") AS "t5" +WHERE "sr_return_amt" > 10000 AND "sr_ticket_number" IS NOT NULL AND "sr_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_ticket_number" = "t7"."sr_ticket_number" AND "t1"."ss_item_sk" = "t7"."sr_item_sk" +GROUP BY "t1"."ss_item_sk" + hive.sql.query.fieldNames ss_item_sk,$f1,$f2,$f3,$f4 + hive.sql.query.fieldTypes bigint,bigint,bigint,decimal(22,2),decimal(22,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_item_sk (type: bigint), $f1 (type: bigint), $f2 (type: bigint), $f3 (type: decimal(22,2)), $f4 (type: decimal(22,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: 0 (type: int), (CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) (type: decimal(35,20)) + null sort order: az + sort order: ++ + Map-reduce partition columns: 0 (type: int) + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(22,2)), _col4 (type: decimal(22,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: cs + properties: + hive.sql.query SELECT "t1"."cs_item_sk", SUM("t7"."$f1") AS "$f1", SUM("t1"."$f2") AS "$f2", SUM("t7"."$f3") AS "$f3", SUM("t1"."$f4") AS "$f4" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_order_number", CASE WHEN "cs_quantity" IS NOT NULL THEN "cs_quantity" ELSE 0 END AS "$f2", CASE WHEN "cs_net_paid" IS NOT NULL THEN "cs_net_paid" ELSE 0 END AS "$f4" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_order_number", "cs_quantity", "cs_net_paid", "cs_net_profit" +FROM "catalog_sales") AS "t" +WHERE "cs_quantity" > 0 AND ("cs_net_profit" > 1 AND "cs_net_paid" > 0) AND ("cs_order_number" IS NOT NULL AND ("cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL))) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2000 AND "d_moy" = 12 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "cr_item_sk", "cr_order_number", CASE WHEN "cr_return_quantity" IS NOT NULL THEN "cr_return_quantity" ELSE 0 END AS "$f1", CASE WHEN "cr_return_amount" IS NOT NULL THEN "cr_return_amount" ELSE 0 END AS "$f3" +FROM (SELECT "cr_item_sk", "cr_order_number", "cr_return_quantity", "cr_return_amount" +FROM "catalog_returns") AS "t5" +WHERE "cr_return_amount" > 10000 AND "cr_order_number" IS NOT NULL AND "cr_item_sk" IS NOT NULL) AS "t7" ON "t1"."cs_order_number" = "t7"."cr_order_number" AND "t1"."cs_item_sk" = "t7"."cr_item_sk" +GROUP BY "t1"."cs_item_sk" + hive.sql.query.fieldNames cs_item_sk,$f1,$f2,$f3,$f4 + hive.sql.query.fieldTypes bigint,bigint,bigint,decimal(22,2),decimal(22,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_item_sk (type: bigint), $f1 (type: bigint), $f2 (type: bigint), $f3 (type: decimal(22,2)), $f4 (type: decimal(22,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: 0 (type: int), (CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) (type: decimal(35,20)) + null sort order: az + sort order: ++ + Map-reduce partition columns: 0 (type: int) + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(22,2)), _col4 (type: decimal(22,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 10 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: bigint), VALUE._col1 (type: bigint), VALUE._col2 (type: bigint), VALUE._col3 (type: decimal(22,2)), VALUE._col4 (type: decimal(22,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: bigint, _col1: bigint, _col2: bigint, _col3: decimal(22,2), _col4: decimal(22,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: (CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) ASC NULLS LAST + partition by: 0 + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: (CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: rank_window_0 (type: int), _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(22,2)), _col4 (type: decimal(22,2)) + outputColumnNames: rank_window_0, _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: 0 (type: int), (CAST( _col3 AS decimal(15,4)) / CAST( _col4 AS decimal(15,4))) (type: decimal(35,20)) + null sort order: az + sort order: ++ + Map-reduce partition columns: 0 (type: int) + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + value expressions: rank_window_0 (type: int), _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(22,2)), _col4 (type: decimal(22,2)) + Reducer 11 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: int), VALUE._col1 (type: bigint), VALUE._col2 (type: bigint), VALUE._col3 (type: bigint), VALUE._col4 (type: decimal(22,2)), VALUE._col5 (type: decimal(22,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: (CAST( _col4 AS decimal(15,4)) / CAST( _col5 AS decimal(15,4))) ASC NULLS LAST + partition by: 0 + raw input shape: + window functions: + window function definition + alias: rank_window_1 + arguments: (CAST( _col4 AS decimal(15,4)) / CAST( _col5 AS decimal(15,4))) + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: ((_col0 <= 10) or (rank_window_1 <= 10)) (type: boolean) + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'catalog' (type: string), _col1 (type: bigint), (CAST( _col2 AS decimal(15,4)) / CAST( _col3 AS decimal(15,4))) (type: decimal(35,20)), _col0 (type: int), rank_window_1 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: string), _col3 (type: int), _col4 (type: int), _col1 (type: bigint), _col2 (type: decimal(35,20)) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 2 Data size: 496 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: bigint), _col4 (type: decimal(35,20)) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: bigint), _col4 (type: decimal(35,20)) + Statistics: Num rows: 2 Data size: 496 Basic stats: COMPLETE Column stats: NONE + Reducer 13 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: bigint), VALUE._col1 (type: bigint), VALUE._col2 (type: bigint), VALUE._col3 (type: decimal(22,2)), VALUE._col4 (type: decimal(22,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: bigint, _col1: bigint, _col2: bigint, _col3: decimal(22,2), _col4: decimal(22,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: (CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) ASC NULLS LAST + partition by: 0 + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: (CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: rank_window_0 (type: int), _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(22,2)), _col4 (type: decimal(22,2)) + outputColumnNames: rank_window_0, _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: 0 (type: int), (CAST( _col3 AS decimal(15,4)) / CAST( _col4 AS decimal(15,4))) (type: decimal(35,20)) + null sort order: az + sort order: ++ + Map-reduce partition columns: 0 (type: int) + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + value expressions: rank_window_0 (type: int), _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(22,2)), _col4 (type: decimal(22,2)) + Reducer 14 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: int), VALUE._col1 (type: bigint), VALUE._col2 (type: bigint), VALUE._col3 (type: bigint), VALUE._col4 (type: decimal(22,2)), VALUE._col5 (type: decimal(22,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: (CAST( _col4 AS decimal(15,4)) / CAST( _col5 AS decimal(15,4))) ASC NULLS LAST + partition by: 0 + raw input shape: + window functions: + window function definition + alias: rank_window_1 + arguments: (CAST( _col4 AS decimal(15,4)) / CAST( _col5 AS decimal(15,4))) + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: ((_col0 <= 10) or (rank_window_1 <= 10)) (type: boolean) + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'store' (type: string), _col1 (type: bigint), (CAST( _col2 AS decimal(15,4)) / CAST( _col3 AS decimal(15,4))) (type: decimal(35,20)), _col0 (type: int), rank_window_1 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +++++ + keys: _col0 (type: string), _col3 (type: int), _col4 (type: int), _col1 (type: bigint), _col2 (type: decimal(35,20)) + null sort order: zzzzz + Statistics: Num rows: 2 Data size: 496 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + keys: _col0 (type: string), _col3 (type: int), _col4 (type: int), _col1 (type: bigint), _col2 (type: decimal(35,20)) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 2 Data size: 496 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: bigint), _col4 (type: decimal(35,20)) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: bigint), _col4 (type: decimal(35,20)) + Statistics: Num rows: 2 Data size: 496 Basic stats: COMPLETE Column stats: NONE + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: bigint), VALUE._col1 (type: bigint), VALUE._col2 (type: bigint), VALUE._col3 (type: decimal(22,2)), VALUE._col4 (type: decimal(22,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: bigint, _col1: bigint, _col2: bigint, _col3: decimal(22,2), _col4: decimal(22,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: (CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) ASC NULLS LAST + partition by: 0 + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: (CAST( _col1 AS decimal(15,4)) / CAST( _col2 AS decimal(15,4))) + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: rank_window_0 (type: int), _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(22,2)), _col4 (type: decimal(22,2)) + outputColumnNames: rank_window_0, _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: 0 (type: int), (CAST( _col3 AS decimal(15,4)) / CAST( _col4 AS decimal(15,4))) (type: decimal(35,20)) + null sort order: az + sort order: ++ + Map-reduce partition columns: 0 (type: int) + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + value expressions: rank_window_0 (type: int), _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(22,2)), _col4 (type: decimal(22,2)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: int), VALUE._col1 (type: bigint), VALUE._col2 (type: bigint), VALUE._col3 (type: bigint), VALUE._col4 (type: decimal(22,2)), VALUE._col5 (type: decimal(22,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: (CAST( _col4 AS decimal(15,4)) / CAST( _col5 AS decimal(15,4))) ASC NULLS LAST + partition by: 0 + raw input shape: + window functions: + window function definition + alias: rank_window_1 + arguments: (CAST( _col4 AS decimal(15,4)) / CAST( _col5 AS decimal(15,4))) + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: ((_col0 <= 10) or (rank_window_1 <= 10)) (type: boolean) + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'web' (type: string), _col1 (type: bigint), (CAST( _col2 AS decimal(15,4)) / CAST( _col3 AS decimal(15,4))) (type: decimal(35,20)), _col0 (type: int), rank_window_1 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: string), _col3 (type: int), _col4 (type: int), _col1 (type: bigint), _col2 (type: decimal(35,20)) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 2 Data size: 496 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: bigint), _col4 (type: decimal(35,20)) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: bigint), _col4 (type: decimal(35,20)) + Statistics: Num rows: 2 Data size: 496 Basic stats: COMPLETE Column stats: NONE + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + keys: KEY._col0 (type: string), KEY._col1 (type: int), KEY._col2 (type: int), KEY._col3 (type: bigint), KEY._col4 (type: decimal(35,20)) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col3 (type: bigint), _col4 (type: decimal(35,20)), _col1 (type: int), _col2 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +++++ + keys: _col0 (type: string), _col3 (type: int), _col4 (type: int), _col1 (type: bigint), _col2 (type: decimal(35,20)) + null sort order: zzzzz + Statistics: Num rows: 2 Data size: 496 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + keys: _col0 (type: string), _col3 (type: int), _col4 (type: int), _col1 (type: bigint), _col2 (type: decimal(35,20)) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 2 Data size: 496 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: bigint), _col4 (type: decimal(35,20)) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: bigint), _col4 (type: decimal(35,20)) + Statistics: Num rows: 2 Data size: 496 Basic stats: COMPLETE Column stats: NONE + Reducer 7 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + keys: KEY._col0 (type: string), KEY._col1 (type: int), KEY._col2 (type: int), KEY._col3 (type: bigint), KEY._col4 (type: decimal(35,20)) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col3 (type: bigint), _col4 (type: decimal(35,20)), _col1 (type: int), _col2 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col3 (type: int), _col4 (type: int) + null sort order: zzz + sort order: +++ + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint), _col2 (type: decimal(35,20)) + Reducer 8 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: bigint), VALUE._col1 (type: decimal(35,20)), KEY.reducesinkkey1 (type: int), KEY.reducesinkkey2 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 248 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Union 4 + Vertex: Union 4 + Union 6 + Vertex: Union 6 + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query5.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query5.q.out new file mode 100644 index 000000000000..480b5cd4e320 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query5.q.out @@ -0,0 +1,158 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Map 1 <- Union 2 (CONTAINS) + Map 5 <- Union 2 (CONTAINS) + Map 6 <- Union 2 (CONTAINS) + Reducer 3 <- Union 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + Statistics: Num rows: 1 Data size: 632 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'store channel' (type: string), concat('store', s_store_id) (type: string), $f1 (type: decimal(17,2)), $f3 (type: decimal(17,2)), ($f2 - $f4) (type: decimal(18,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 632 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: string), _col1 (type: string) + null sort order: zz + Statistics: Num rows: 3 Data size: 1896 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col2), sum(_col3), sum(_col4) + keys: _col0 (type: string), _col1 (type: string), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 9 Data size: 5688 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + Statistics: Num rows: 9 Data size: 5688 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(27,2)), _col4 (type: decimal(27,2)), _col5 (type: decimal(28,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 5 + Map Operator Tree: + TableScan + alias: catalog_sales + Statistics: Num rows: 1 Data size: 632 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'catalog channel' (type: string), concat('catalog_page', cp_catalog_page_id) (type: string), $f1 (type: decimal(17,2)), $f3 (type: decimal(17,2)), ($f2 - $f4) (type: decimal(18,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 632 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: string), _col1 (type: string) + null sort order: zz + Statistics: Num rows: 3 Data size: 1896 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col2), sum(_col3), sum(_col4) + keys: _col0 (type: string), _col1 (type: string), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 9 Data size: 5688 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + Statistics: Num rows: 9 Data size: 5688 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(27,2)), _col4 (type: decimal(27,2)), _col5 (type: decimal(28,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: web_sales + Statistics: Num rows: 1 Data size: 632 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'web channel' (type: string), concat('web_site', web_site_id) (type: string), $f1 (type: decimal(17,2)), $f3 (type: decimal(17,2)), ($f2 - $f4) (type: decimal(18,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 632 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: string), _col1 (type: string) + null sort order: zz + Statistics: Num rows: 3 Data size: 1896 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col2), sum(_col3), sum(_col4) + keys: _col0 (type: string), _col1 (type: string), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 9 Data size: 5688 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + Statistics: Num rows: 9 Data size: 5688 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(27,2)), _col4 (type: decimal(27,2)), _col5 (type: decimal(28,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1), sum(VALUE._col2) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col3, _col4, _col5 + Statistics: Num rows: 4 Data size: 2528 Basic stats: COMPLETE Column stats: NONE + pruneGroupingSetId: true + Select Operator + expressions: _col0 (type: string), _col1 (type: string), _col3 (type: decimal(27,2)), _col4 (type: decimal(27,2)), _col5 (type: decimal(28,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 4 Data size: 2528 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string) + null sort order: zz + sort order: ++ + Statistics: Num rows: 4 Data size: 2528 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(27,2)), _col3 (type: decimal(27,2)), _col4 (type: decimal(28,2)) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), VALUE._col0 (type: decimal(27,2)), VALUE._col1 (type: decimal(27,2)), VALUE._col2 (type: decimal(28,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 4 Data size: 2528 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 4 Data size: 2528 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 4 Data size: 2528 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Union 2 + Vertex: Union 2 + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query50.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query50.q.out new file mode 100644 index 000000000000..8abc4e5bfe78 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query50.q.out @@ -0,0 +1,45 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t17"."$f0", "t17"."$f1", "t17"."$f2", "t17"."$f3", "t17"."$f4", "t17"."$f5", "t17"."$f6", "t17"."$f7", "t17"."$f8", "t17"."$f9", "t17"."$f10", "t17"."$f11", "t17"."$f12", "t17"."$f13", "t17"."$f14" +FROM (SELECT "t14"."s_store_name" AS "$f0", "t14"."s_company_id" AS "$f1", "t14"."s_street_number" AS "$f2", "t14"."s_street_name" AS "$f3", "t14"."s_street_type" AS "$f4", "t14"."s_suite_number" AS "$f5", "t14"."s_city" AS "$f6", "t14"."s_county" AS "$f7", "t14"."s_state" AS "$f8", "t14"."s_zip" AS "$f9", SUM(CASE WHEN "t11"."sr_returned_date_sk" - "t1"."ss_sold_date_sk" <= 30 THEN 1 ELSE 0 END) AS "$f10", SUM(CASE WHEN "t11"."sr_returned_date_sk" - "t1"."ss_sold_date_sk" > 30 AND "t11"."sr_returned_date_sk" - "t1"."ss_sold_date_sk" <= 60 THEN 1 ELSE 0 END) AS "$f11", SUM(CASE WHEN "t11"."sr_returned_date_sk" - "t1"."ss_sold_date_sk" > 60 AND "t11"."sr_returned_date_sk" - "t1"."ss_sold_date_sk" <= 90 THEN 1 ELSE 0 END) AS "$f12", SUM(CASE WHEN "t11"."sr_returned_date_sk" - "t1"."ss_sold_date_sk" > 90 AND "t11"."sr_returned_date_sk" - "t1"."ss_sold_date_sk" <= 120 THEN 1 ELSE 0 END) AS "$f13", SUM(CASE WHEN "t11"."sr_returned_date_sk" - "t1"."ss_sold_date_sk" > 120 THEN 1 ELSE 0 END) AS "$f14" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ticket_number" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ticket_number" +FROM "store_sales") AS "t" +WHERE "ss_ticket_number" IS NOT NULL AND "ss_item_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk" +FROM "date_dim") AS "t2" +WHERE "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "t7"."sr_returned_date_sk", "t7"."sr_item_sk", "t7"."sr_customer_sk", "t7"."sr_ticket_number", "t10"."d_date_sk" +FROM (SELECT "sr_returned_date_sk", "sr_item_sk", "sr_customer_sk", "sr_ticket_number" +FROM (SELECT "sr_returned_date_sk", "sr_item_sk", "sr_customer_sk", "sr_ticket_number" +FROM "store_returns") AS "t5" +WHERE "sr_ticket_number" IS NOT NULL AND "sr_item_sk" IS NOT NULL AND "sr_customer_sk" IS NOT NULL AND "sr_returned_date_sk" IS NOT NULL) AS "t7" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t8" +WHERE "d_year" = 2000 AND "d_moy" = 9 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t7"."sr_returned_date_sk" = "t10"."d_date_sk") AS "t11" ON "t1"."ss_ticket_number" = "t11"."sr_ticket_number" AND "t1"."ss_item_sk" = "t11"."sr_item_sk" AND "t1"."ss_customer_sk" = "t11"."sr_customer_sk" +INNER JOIN (SELECT "s_store_sk", "s_store_name", "s_company_id", "s_street_number", "s_street_name", "s_street_type", "s_suite_number", "s_city", "s_county", "s_state", "s_zip" +FROM (SELECT "s_store_sk", "s_store_name", "s_company_id", "s_street_number", "s_street_name", "s_street_type", "s_suite_number", "s_city", "s_county", "s_state", "s_zip" +FROM "store") AS "t12" +WHERE "s_store_sk" IS NOT NULL) AS "t14" ON "t1"."ss_store_sk" = "t14"."s_store_sk" +GROUP BY "t14"."s_store_name", "t14"."s_company_id", "t14"."s_street_number", "t14"."s_street_name", "t14"."s_street_type", "t14"."s_suite_number", "t14"."s_city", "t14"."s_county", "t14"."s_state", "t14"."s_zip" +ORDER BY "t14"."s_store_name", "t14"."s_company_id", "t14"."s_street_number", "t14"."s_street_name", "t14"."s_street_type", "t14"."s_suite_number", "t14"."s_city", "t14"."s_county", "t14"."s_state", "t14"."s_zip" +FETCH NEXT 100 ROWS ONLY) AS "t17" + hive.sql.query.fieldNames $f0,$f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8,$f9,$f10,$f11,$f12,$f13,$f14 + hive.sql.query.fieldTypes string,int,string,string,string,string,string,string,string,string,bigint,bigint,bigint,bigint,bigint + hive.sql.query.split false + Select Operator + expressions: $f0 (type: string), $f1 (type: int), $f2 (type: string), $f3 (type: string), $f4 (type: string), $f5 (type: string), $f6 (type: string), $f7 (type: string), $f8 (type: string), $f9 (type: string), $f10 (type: bigint), $f11 (type: bigint), $f12 (type: bigint), $f13 (type: bigint), $f14 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query51.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query51.q.out new file mode 100644 index 000000000000..68e206e6ee1a --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query51.q.out @@ -0,0 +1,250 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE) + Reducer 7 <- Map 6 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t1"."ws_item_sk", "t4"."d_date", SUM("t1"."ws_sales_price") AS "$f2" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_sales_price" +FROM "web_sales") AS "t" +WHERE "ws_item_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date", "d_month_seq" +FROM "date_dim") AS "t2" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_sold_date_sk" = "t4"."d_date_sk" +GROUP BY "t1"."ws_item_sk", "t4"."d_date" + hive.sql.query.fieldNames ws_item_sk,d_date,$f2 + hive.sql.query.fieldTypes bigint,string,decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_item_sk (type: bigint), d_date (type: string), $f2 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint), _col1 (type: string) + null sort order: az + sort order: ++ + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_item_sk", "t4"."d_date", SUM("t1"."ss_sales_price") AS "$f2" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_item_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date", "d_month_seq" +FROM "date_dim") AS "t2" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +GROUP BY "t1"."ss_item_sk", "t4"."d_date" + hive.sql.query.fieldNames ss_item_sk,d_date,$f2 + hive.sql.query.fieldTypes bigint,string,decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_item_sk (type: bigint), d_date (type: string), $f2 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint), _col1 (type: string) + null sort order: az + sort order: ++ + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: bigint), KEY.reducesinkkey1 (type: string), VALUE._col0 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: bigint, _col1: string, _col2: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col1 ASC NULLS LAST + partition by: _col0 + raw input shape: + window functions: + window function definition + alias: sum_window_0 + arguments: _col2 + name: sum + window function: GenericUDAFSumHiveDecimal + window frame: ROWS PRECEDING(MAX)~CURRENT + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: bigint), _col1 (type: string), sum_window_0 (type: decimal(27,2)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint), _col1 (type: string) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col0 (type: bigint), _col1 (type: string) + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(27,2)) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Full Outer Join 0 to 1 + keys: + 0 _col0 (type: bigint), _col1 (type: string) + 1 _col0 (type: bigint), _col1 (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: CASE WHEN (_col0 is not null) THEN (_col0) ELSE (_col3) END (type: bigint), CASE WHEN (_col1 is not null) THEN (_col1) ELSE (_col4) END (type: string) + null sort order: az + sort order: ++ + Map-reduce partition columns: CASE WHEN (_col0 is not null) THEN (_col0) ELSE (_col3) END (type: bigint) + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: decimal(27,2)), _col3 (type: bigint), _col4 (type: string), _col5 (type: decimal(27,2)) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: bigint), VALUE._col1 (type: string), VALUE._col2 (type: decimal(27,2)), VALUE._col3 (type: bigint), VALUE._col4 (type: string), VALUE._col5 (type: decimal(27,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: bigint, _col1: string, _col2: decimal(27,2), _col3: bigint, _col4: string, _col5: decimal(27,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: CASE WHEN (_col1 is not null) THEN (_col1) ELSE (_col4) END ASC NULLS LAST + partition by: CASE WHEN (_col0 is not null) THEN (_col0) ELSE (_col3) END + raw input shape: + window functions: + window function definition + alias: max_window_0 + arguments: _col2 + name: max + window function: GenericUDAFMaxEvaluator + window frame: ROWS PRECEDING(MAX)~CURRENT + window function definition + alias: max_window_1 + arguments: _col5 + name: max + window function: GenericUDAFMaxEvaluator + window frame: ROWS PRECEDING(MAX)~CURRENT + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (max_window_0 > max_window_1) (type: boolean) + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: if(_col0 is not null, _col0, _col3) (type: bigint), if(_col1 is not null, _col1, _col4) (type: string) + null sort order: zz + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: if(_col0 is not null, _col0, _col3) (type: bigint), if(_col1 is not null, _col1, _col4) (type: string), _col2 (type: decimal(27,2)), _col5 (type: decimal(27,2)), max_window_0 (type: decimal(27,2)), max_window_1 (type: decimal(27,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint), _col1 (type: string) + null sort order: zz + sort order: ++ + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(27,2)), _col3 (type: decimal(27,2)), _col4 (type: decimal(27,2)), _col5 (type: decimal(27,2)) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: bigint), KEY.reducesinkkey1 (type: string), VALUE._col0 (type: decimal(27,2)), VALUE._col1 (type: decimal(27,2)), VALUE._col2 (type: decimal(27,2)), VALUE._col3 (type: decimal(27,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 7 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: bigint), KEY.reducesinkkey1 (type: string), VALUE._col0 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: bigint, _col1: string, _col2: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col1 ASC NULLS LAST + partition by: _col0 + raw input shape: + window functions: + window function definition + alias: sum_window_0 + arguments: _col2 + name: sum + window function: GenericUDAFSumHiveDecimal + window frame: ROWS PRECEDING(MAX)~CURRENT + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: bigint), _col1 (type: string), sum_window_0 (type: decimal(27,2)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint), _col1 (type: string) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col0 (type: bigint), _col1 (type: string) + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(27,2)) + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query52.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query52.q.out new file mode 100644 index 000000000000..45d0956d1015 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query52.q.out @@ -0,0 +1,36 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(1998 AS INTEGER) AS "d_year", "t9"."i_brand_id" AS "brand_id", "t9"."i_brand" AS "brand", "t9"."$f2" AS "ext_price" +FROM (SELECT "t7"."i_brand_id", "t7"."i_brand", SUM("t1"."ss_ext_sales_price") AS "$f2" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_moy" = 12 AND "d_year" = 1998 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand_id", "i_brand" +FROM (SELECT "i_item_sk", "i_brand_id", "i_brand", "i_manager_id" +FROM "item") AS "t5" +WHERE "i_manager_id" = 1 AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" +GROUP BY "t7"."i_brand_id", "t7"."i_brand" +ORDER BY SUM("t1"."ss_ext_sales_price") DESC, "t7"."i_brand_id" +FETCH NEXT 100 ROWS ONLY) AS "t9" + hive.sql.query.fieldNames d_year,brand_id,brand,ext_price + hive.sql.query.fieldTypes int,int,string,decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: d_year (type: int), brand_id (type: int), brand (type: string), ext_price (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query53.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query53.q.out new file mode 100644 index 000000000000..f951b9c1a65c --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query53.q.out @@ -0,0 +1,126 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t7"."i_manufact_id", "t10"."d_qoy", SUM("t1"."ss_sales_price") AS "$f2" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_item_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk" +FROM "store") AS "t2" +WHERE "s_store_sk" IS NOT NULL) AS "t4" ON "t1"."ss_store_sk" = "t4"."s_store_sk" +INNER JOIN (SELECT "i_item_sk", "i_manufact_id" +FROM (SELECT "i_item_sk", "i_brand", "i_class", "i_category", "i_manufact_id" +FROM "item") AS "t5" +WHERE ("i_category" IN ('Books', 'Children', 'Electronics') AND "i_class" IN ('personal', 'portable', 'reference', 'self-help') AND "i_brand" IN ('exportiunivamalg #9', 'scholaramalgamalg #14', 'scholaramalgamalg #7', 'scholaramalgamalg #9') OR "i_category" IN ('Men', 'Music', 'Women') AND "i_class" IN ('accessories', 'classical', 'fragrances', 'pants') AND "i_brand" IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')) AND "i_class" IN ('accessories', 'classical', 'fragrances', 'pants', 'personal', 'portable', 'reference', 'self-help') AND "i_brand" IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'exportiunivamalg #9', 'importoamalg #1', 'scholaramalgamalg #14', 'scholaramalgamalg #7', 'scholaramalgamalg #9') AND "i_category" IN ('Books', 'Children', 'Electronics', 'Men', 'Music', 'Women') AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_qoy" +FROM (SELECT "d_date_sk", "d_month_seq", "d_qoy" +FROM "date_dim") AS "t8" +WHERE "d_month_seq" IN (1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223) AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."ss_sold_date_sk" = "t10"."d_date_sk" +GROUP BY "t7"."i_manufact_id", "t10"."d_qoy" + hive.sql.query.fieldNames i_manufact_id,d_qoy,$f2 + hive.sql.query.fieldTypes int,int,decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_manufact_id (type: int), $f2 (type: decimal(17,2)) + outputColumnNames: _col0, _col2 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: a + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: int), VALUE._col1 (type: decimal(17,2)) + outputColumnNames: _col0, _col2 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: int, _col2: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col0 ASC NULLS FIRST + partition by: _col0 + raw input shape: + window functions: + window function definition + alias: avg_window_0 + arguments: _col2 + name: avg + window function: GenericUDAFAverageEvaluatorDecimal + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: avg_window_0 (type: decimal(21,6)), _col0 (type: int), _col2 (type: decimal(17,2)) + outputColumnNames: avg_window_0, _col0, _col2 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: if((avg_window_0 > 0), ((abs((_col2 - avg_window_0)) / avg_window_0) > 0.1), false) (type: boolean) + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +++ + keys: avg_window_0 (type: decimal(21,6)), _col2 (type: decimal(17,2)), _col0 (type: int) + null sort order: zzz + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col0 (type: int), _col2 (type: decimal(17,2)), avg_window_0 (type: decimal(21,6)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: decimal(21,6)), _col1 (type: decimal(17,2)), _col0 (type: int) + null sort order: zzz + sort order: +++ + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey2 (type: int), KEY.reducesinkkey1 (type: decimal(17,2)), KEY.reducesinkkey0 (type: decimal(21,6)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query54.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query54.q.out new file mode 100644 index 000000000000..e4d814999a10 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query54.q.out @@ -0,0 +1,393 @@ +Warning: Shuffle Join MERGEJOIN[68][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product +Warning: Shuffle Join MERGEJOIN[70][tables = [$hdt$_3, $hdt$_4]] in Stage 'Reducer 12' is a cross product +Warning: Shuffle Join MERGEJOIN[71][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3]] in Stage 'Reducer 4' is a cross product +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 12 <- Map 11 (XPROD_EDGE), Map 13 (XPROD_EDGE) + Reducer 2 <- Map 1 (XPROD_EDGE), Map 9 (XPROD_EDGE) + Reducer 3 <- Map 10 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 12 (XPROD_EDGE), Reducer 3 (XPROD_EDGE) + Reducer 5 <- Map 14 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) + Reducer 7 <- Reducer 6 (SIMPLE_EDGE) + Reducer 8 <- Reducer 7 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: date_dim + properties: + hive.sql.query SELECT "t1"."d_date_sk", "t1"."d_month_seq", "t5"."$f0" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM "date_dim") AS "t" +WHERE "d_date_sk" IS NOT NULL AND "d_month_seq" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_month_seq" + 1 AS "$f0" +FROM (SELECT "d_month_seq", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 1999 AND "d_moy" = 3 AND "d_month_seq" IS NOT NULL +GROUP BY "d_month_seq" + 1) AS "t5" ON "t1"."d_month_seq" >= "t5"."$f0" + hive.sql.query.fieldNames d_date_sk,d_month_seq,$f0 + hive.sql.query.fieldTypes int,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: d_date_sk (type: int), d_month_seq (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col1 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 10 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL + hive.sql.query.fieldNames ss_sold_date_sk,ss_customer_sk,ss_ext_sales_price + hive.sql.query.fieldTypes int,int,decimal(7,2) + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_sold_date_sk (type: int), ss_customer_sk (type: int), ss_ext_sales_price (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 120 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col2 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 11 + Map Operator Tree: + TableScan + alias: date_dim + properties: + hive.sql.query SELECT COUNT(*) AS "cnt" +FROM (SELECT "d_month_seq" + 1 AS "$f0" +FROM (SELECT "d_month_seq", "d_year", "d_moy" +FROM "date_dim") AS "t" +WHERE "d_year" = 1999 AND "d_moy" = 3 +GROUP BY "d_month_seq" + 1) AS "t2" + hive.sql.query.fieldNames cnt + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cnt (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: sq_count_check(_col0) (type: boolean) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 13 + Map Operator Tree: + TableScan + alias: date_dim + properties: + hive.sql.query SELECT "d_month_seq" + 3 AS "$f0" +FROM (SELECT "d_month_seq", "d_year", "d_moy" +FROM "date_dim") AS "t" +WHERE "d_year" = 1999 AND "d_moy" = 3 AND "d_month_seq" IS NOT NULL +GROUP BY "d_month_seq" + 3 + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 14 + Map Operator Tree: + TableScan + alias: customer_address + properties: + hive.sql.query SELECT "t1"."ca_address_sk", "t1"."ca_county", "t1"."ca_state", "t4"."s_county", "t4"."s_state", "t22"."c_customer_sk", "t22"."c_current_addr_sk" +FROM (SELECT "ca_address_sk", "ca_county", "ca_state" +FROM (SELECT "ca_address_sk", "ca_county", "ca_state" +FROM "customer_address") AS "t" +WHERE "ca_address_sk" IS NOT NULL AND "ca_county" IS NOT NULL AND "ca_state" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "s_county", "s_state" +FROM (SELECT "s_county", "s_state" +FROM "store") AS "t2" +WHERE "s_county" IS NOT NULL AND "s_state" IS NOT NULL) AS "t4" ON "t1"."ca_county" = "t4"."s_county" AND "t1"."ca_state" = "t4"."s_state" +INNER JOIN (SELECT "t21"."c_customer_sk", "t21"."c_current_addr_sk" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk" +FROM "catalog_sales") AS "t5" +WHERE "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL AND "cs_bill_customer_sk" IS NOT NULL +UNION ALL +SELECT "ws_sold_date_sk" AS "sold_date_sk", "ws_bill_customer_sk" AS "customer_sk", "ws_item_sk" AS "item_sk" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_customer_sk" +FROM "web_sales") AS "t8" +WHERE "ws_item_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL AND "ws_bill_customer_sk" IS NOT NULL) AS "t11") AS "t12" +INNER JOIN (SELECT "i_item_sk" +FROM (SELECT "i_item_sk", "i_class", "i_category" +FROM "item") AS "t13" +WHERE "i_category" = 'Jewelry' AND "i_class" = 'consignment' AND "i_item_sk" IS NOT NULL) AS "t15" ON "t12"."cs_item_sk" = "t15"."i_item_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t16" +WHERE "d_moy" = 3 AND "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t18" ON "t12"."cs_sold_date_sk" = "t18"."d_date_sk" +INNER JOIN (SELECT "c_customer_sk", "c_current_addr_sk" +FROM (SELECT "c_customer_sk", "c_current_addr_sk" +FROM "customer") AS "t19" +WHERE "c_customer_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL) AS "t21" ON "t12"."cs_bill_customer_sk" = "t21"."c_customer_sk" +GROUP BY "t21"."c_customer_sk", "t21"."c_current_addr_sk") AS "t22" ON "t1"."ca_address_sk" = "t22"."c_current_addr_sk" + hive.sql.query.fieldNames ca_address_sk,ca_county,ca_state,s_county,s_state,c_customer_sk,c_current_addr_sk + hive.sql.query.fieldTypes int,string,string,string,string,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_customer_sk (type: int) + outputColumnNames: _col5 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col5 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col5 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: date_dim + properties: + hive.sql.query SELECT COUNT(*) AS "cnt" +FROM (SELECT "d_month_seq" + 3 AS "$f0" +FROM (SELECT "d_month_seq", "d_year", "d_moy" +FROM "date_dim") AS "t" +WHERE "d_year" = 1999 AND "d_moy" = 3 +GROUP BY "d_month_seq" + 3) AS "t2" + hive.sql.query.fieldNames cnt + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cnt (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: sq_count_check(_col0) (type: boolean) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 12 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1 + Statistics: Num rows: 1 Data size: 13 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 13 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int) + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 17 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 17 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col1, _col5, _col6 + Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 18 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col5 (type: int), _col6 (type: decimal(7,2)) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col5, _col6, _col8 + residual filter predicates: {(_col1 <= _col8)} + Statistics: Num rows: 1 Data size: 32 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col5 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col5 (type: int) + Statistics: Num rows: 1 Data size: 32 Basic stats: COMPLETE Column stats: NONE + value expressions: _col6 (type: decimal(7,2)) + Reducer 5 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col5 (type: int) + 1 _col5 (type: int) + outputColumnNames: _col6, _col14 + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col6) + keys: _col14 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: + + keys: UDFToInteger((_col1 / 50)) (type: int) + null sort order: z + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: UDFToInteger((_col1 / 50)) (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count() + keys: _col0 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint) + Reducer 7 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + keys: KEY._col0 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: int), _col1 (type: bigint) + null sort order: zz + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col0 (type: int), _col1 (type: bigint), (_col0 * 50) (type: int) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: bigint) + null sort order: zz + sort order: ++ + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: int) + Reducer 8 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: int), KEY.reducesinkkey1 (type: bigint), VALUE._col0 (type: int) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query55.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query55.q.out new file mode 100644 index 000000000000..eea8016cd00a --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query55.q.out @@ -0,0 +1,36 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t10"."brand_id", "t10"."brand", "t10"."ext_price" +FROM (SELECT "t7"."i_brand_id" AS "brand_id", "t7"."i_brand" AS "brand", SUM("t1"."ss_ext_sales_price") AS "ext_price", "t7"."i_brand_id" AS "(tok_table_or_col i_brand_id)" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_moy" = 12 AND "d_year" = 2001 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand_id", "i_brand" +FROM (SELECT "i_item_sk", "i_brand_id", "i_brand", "i_manager_id" +FROM "item") AS "t5" +WHERE "i_manager_id" = 36 AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" +GROUP BY "t7"."i_brand_id", "t7"."i_brand" +ORDER BY SUM("t1"."ss_ext_sales_price") DESC, "t7"."i_brand_id" +FETCH NEXT 100 ROWS ONLY) AS "t10" + hive.sql.query.fieldNames brand_id,brand,ext_price + hive.sql.query.fieldTypes int,string,decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: brand_id (type: int), brand (type: string), ext_price (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query56.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query56.q.out new file mode 100644 index 000000000000..93c82f96d09b --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query56.q.out @@ -0,0 +1,370 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 10 <- Map 13 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 11 <- Reducer 10 (SIMPLE_EDGE), Union 4 (CONTAINS) + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Union 4 (CONTAINS) + Reducer 5 <- Union 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) + Reducer 8 <- Map 12 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 9 <- Reducer 8 (SIMPLE_EDGE), Union 4 (CONTAINS) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_sold_date_sk", "t1"."ss_item_sk", "t1"."ss_addr_sk", "t1"."ss_ext_sales_price", "t10"."d_date_sk", "t10"."d_year", "t10"."d_moy", "t4"."ca_address_sk", "t4"."ca_gmt_offset", "t7"."i_item_sk", "t7"."i_item_id" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_addr_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_addr_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_addr_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_gmt_offset" +FROM (SELECT "ca_address_sk", "ca_gmt_offset" +FROM "customer_address") AS "t2" +WHERE "ca_gmt_offset" = -8 AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."ss_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t5" +WHERE "i_item_id" IS NOT NULL AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t8" +WHERE "d_year" = 2000 AND "d_moy" = 1 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."ss_sold_date_sk" = "t10"."d_date_sk" + hive.sql.query.fieldNames ss_sold_date_sk,ss_item_sk,ss_addr_sk,ss_ext_sales_price,d_date_sk,d_year,d_moy,ca_address_sk,ca_gmt_offset,i_item_sk,i_item_id + hive.sql.query.fieldTypes int,bigint,int,decimal(7,2),int,int,int,int,decimal(5,2),bigint,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_ext_sales_price (type: decimal(7,2)), i_item_id (type: string) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col10 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col10 (type: string) + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 12 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t1"."cs_sold_date_sk", "t1"."cs_bill_addr_sk", "t1"."cs_item_sk", "t1"."cs_ext_sales_price", "t10"."d_date_sk", "t10"."d_year", "t10"."d_moy", "t4"."ca_address_sk", "t4"."ca_gmt_offset", "t7"."i_item_sk", "t7"."i_item_id" +FROM (SELECT "cs_sold_date_sk", "cs_bill_addr_sk", "cs_item_sk", "cs_ext_sales_price" +FROM (SELECT "cs_sold_date_sk", "cs_bill_addr_sk", "cs_item_sk", "cs_ext_sales_price" +FROM "catalog_sales") AS "t" +WHERE "cs_sold_date_sk" IS NOT NULL AND "cs_bill_addr_sk" IS NOT NULL AND "cs_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_gmt_offset" +FROM (SELECT "ca_address_sk", "ca_gmt_offset" +FROM "customer_address") AS "t2" +WHERE "ca_gmt_offset" = -8 AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."cs_bill_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t5" +WHERE "i_item_id" IS NOT NULL AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."cs_item_sk" = "t7"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t8" +WHERE "d_year" = 2000 AND "d_moy" = 1 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."cs_sold_date_sk" = "t10"."d_date_sk" + hive.sql.query.fieldNames cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price,d_date_sk,d_year,d_moy,ca_address_sk,ca_gmt_offset,i_item_sk,i_item_id + hive.sql.query.fieldTypes int,int,bigint,decimal(7,2),int,int,int,int,decimal(5,2),bigint,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_ext_sales_price (type: decimal(7,2)), i_item_id (type: string) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col10 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col10 (type: string) + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 13 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t1"."ws_sold_date_sk", "t1"."ws_item_sk", "t1"."ws_bill_addr_sk", "t1"."ws_ext_sales_price", "t10"."d_date_sk", "t10"."d_year", "t10"."d_moy", "t4"."ca_address_sk", "t4"."ca_gmt_offset", "t7"."i_item_sk", "t7"."i_item_id" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_addr_sk", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_addr_sk", "ws_ext_sales_price" +FROM "web_sales") AS "t" +WHERE "ws_sold_date_sk" IS NOT NULL AND "ws_bill_addr_sk" IS NOT NULL AND "ws_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_gmt_offset" +FROM (SELECT "ca_address_sk", "ca_gmt_offset" +FROM "customer_address") AS "t2" +WHERE "ca_gmt_offset" = -8 AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."ws_bill_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t5" +WHERE "i_item_id" IS NOT NULL AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ws_item_sk" = "t7"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t8" +WHERE "d_year" = 2000 AND "d_moy" = 1 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."ws_sold_date_sk" = "t10"."d_date_sk" + hive.sql.query.fieldNames ws_sold_date_sk,ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price,d_date_sk,d_year,d_moy,ca_address_sk,ca_gmt_offset,i_item_sk,i_item_id + hive.sql.query.fieldTypes int,bigint,int,decimal(7,2),int,int,int,int,decimal(5,2),bigint,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_ext_sales_price (type: decimal(7,2)), i_item_id (type: string) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col10 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col10 (type: string) + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: item + properties: + hive.sql.query SELECT "i_item_id" +FROM (SELECT "i_item_id", "i_color" +FROM "item") AS "t" +WHERE "i_color" IN ('chiffon', 'lace', 'orchid') AND "i_item_id" IS NOT NULL + hive.sql.query.fieldNames i_item_id + hive.sql.query.fieldTypes string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_id (type: string) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 10 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col10 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3) + keys: _col10 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 11 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col1) + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(27,2)) + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col10 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3) + keys: _col10 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col1) + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(27,2)) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: + + keys: _col1 (type: decimal(27,2)) + null sort order: z + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Reduce Output Operator + key expressions: _col1 (type: decimal(27,2)) + null sort order: z + sort order: + + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: string), KEY.reducesinkkey0 (type: decimal(27,2)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 8 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col10 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3) + keys: _col10 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 9 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col1) + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(27,2)) + Union 4 + Vertex: Union 4 + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query57.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query57.q.out new file mode 100644 index 000000000000..92711e720d85 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query57.q.out @@ -0,0 +1,297 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) + Reducer 7 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t4"."cc_name", "t7"."i_brand", "t7"."i_category", "t10"."d_year", "t10"."d_moy", SUM("t1"."cs_sales_price") AS "$f5" +FROM (SELECT "cs_sold_date_sk", "cs_call_center_sk", "cs_item_sk", "cs_sales_price" +FROM (SELECT "cs_sold_date_sk", "cs_call_center_sk", "cs_item_sk", "cs_sales_price" +FROM "catalog_sales") AS "t" +WHERE "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL AND "cs_call_center_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "cc_call_center_sk", "cc_name" +FROM (SELECT "cc_call_center_sk", "cc_name" +FROM "call_center") AS "t2" +WHERE "cc_call_center_sk" IS NOT NULL AND "cc_name" IS NOT NULL) AS "t4" ON "t1"."cs_call_center_sk" = "t4"."cc_call_center_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand", "i_category" +FROM (SELECT "i_item_sk", "i_brand", "i_category" +FROM "item") AS "t5" +WHERE "i_item_sk" IS NOT NULL AND "i_category" IS NOT NULL AND "i_brand" IS NOT NULL) AS "t7" ON "t1"."cs_item_sk" = "t7"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t8" +WHERE ("d_year" = 2000 OR "d_year" = 1999 AND "d_moy" = 12 OR "d_year" = 2001 AND "d_moy" = 1) AND "d_year" IN (1999, 2000, 2001) AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."cs_sold_date_sk" = "t10"."d_date_sk" +GROUP BY "t4"."cc_name", "t7"."i_brand", "t7"."i_category", "t10"."d_year", "t10"."d_moy" + hive.sql.query.fieldNames cc_name,i_brand,i_category,d_year,d_moy,$f5 + hive.sql.query.fieldTypes string,string,string,int,int,decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cc_name (type: string), i_brand (type: string), i_category (type: string), d_year (type: int), d_moy (type: int), $f5 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: string), _col1 (type: string), _col0 (type: string), _col3 (type: int) + null sort order: aaaa + sort order: ++++ + Map-reduce partition columns: _col2 (type: string), _col1 (type: string), _col0 (type: string), _col3 (type: int) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: int), _col5 (type: decimal(17,2)) + Reduce Output Operator + key expressions: _col2 (type: string), _col1 (type: string), _col0 (type: string), _col3 (type: int), _col4 (type: int) + null sort order: aaazz + sort order: +++++ + Map-reduce partition columns: _col2 (type: string), _col1 (type: string), _col0 (type: string) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey2 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey0 (type: string), KEY.reducesinkkey3 (type: int), VALUE._col0 (type: int), VALUE._col1 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: string, _col2: string, _col3: int, _col4: int, _col5: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col2 ASC NULLS FIRST, _col1 ASC NULLS FIRST, _col0 ASC NULLS FIRST, _col3 ASC NULLS FIRST + partition by: _col2, _col1, _col0, _col3 + raw input shape: + window functions: + window function definition + alias: avg_window_0 + arguments: _col5 + name: avg + window function: GenericUDAFAverageEvaluatorDecimal + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: avg_window_0 (type: decimal(21,6)), _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: int), _col4 (type: int), _col5 (type: decimal(17,2)) + outputColumnNames: avg_window_0, _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: string), _col1 (type: string), _col0 (type: string), _col3 (type: int), _col4 (type: int) + null sort order: aaazz + sort order: +++++ + Map-reduce partition columns: _col2 (type: string), _col1 (type: string), _col0 (type: string) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + value expressions: avg_window_0 (type: decimal(21,6)), _col5 (type: decimal(17,2)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: decimal(21,6)), KEY.reducesinkkey2 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey0 (type: string), KEY.reducesinkkey3 (type: int), KEY.reducesinkkey4 (type: int), VALUE._col1 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: decimal(21,6), _col1: string, _col2: string, _col3: string, _col4: int, _col5: int, _col6: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col4 ASC NULLS LAST, _col5 ASC NULLS LAST + partition by: _col3, _col2, _col1 + raw input shape: + window functions: + window function definition + alias: rank_window_1 + arguments: _col4, _col5 + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: ((_col0 > 0) and rank_window_1 is not null and (_col4 = 2000)) (type: boolean) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: rank_window_1 (type: int), _col0 (type: decimal(21,6)), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: int), _col5 (type: int), _col6 (type: decimal(17,2)) + outputColumnNames: rank_window_1, _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: if((_col0 > 0), ((abs((_col6 - _col0)) / _col0) > 0.1), false) (type: boolean) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col3 (type: string), _col2 (type: string), _col1 (type: string), _col4 (type: int), _col5 (type: int), _col6 (type: decimal(17,2)), _col0 (type: decimal(21,6)), rank_window_1 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col7 (type: int), _col2 (type: string) + null sort order: zzzz + sort order: ++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col7 (type: int), _col2 (type: string) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: int), _col4 (type: int), _col5 (type: decimal(17,2)), _col6 (type: decimal(21,6)) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: string), _col1 (type: string), _col7 (type: int), _col2 (type: string) + 1 _col0 (type: string), _col1 (type: string), _col4 (type: int), _col2 (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col11 + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col7 (type: int), _col2 (type: string) + null sort order: zzzz + sort order: ++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col7 (type: int), _col2 (type: string) + Statistics: Num rows: 1 Data size: 739 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: int), _col4 (type: int), _col5 (type: decimal(17,2)), _col6 (type: decimal(21,6)), _col11 (type: decimal(17,2)) + Reducer 5 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: string), _col1 (type: string), _col7 (type: int), _col2 (type: string) + 1 _col0 (type: string), _col1 (type: string), _col4 (type: int), _col2 (type: string) + outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col6, _col11, _col16 + Statistics: Num rows: 1 Data size: 812 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: (_col5 - _col6) (type: decimal(22,6)), _col3 (type: int) + null sort order: zz + Statistics: Num rows: 1 Data size: 812 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col0 (type: string), _col1 (type: string), _col3 (type: int), _col4 (type: int), _col6 (type: decimal(21,6)), _col5 (type: decimal(17,2)), _col11 (type: decimal(17,2)), _col16 (type: decimal(17,2)), (_col5 - _col6) (type: decimal(22,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 1 Data size: 812 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col8 (type: decimal(22,6)), _col2 (type: int) + null sort order: zz + sort order: ++ + Statistics: Num rows: 1 Data size: 812 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col1 (type: string), _col3 (type: int), _col4 (type: decimal(21,6)), _col5 (type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2)) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: string), VALUE._col1 (type: string), KEY.reducesinkkey1 (type: int), VALUE._col2 (type: int), VALUE._col3 (type: decimal(21,6)), VALUE._col4 (type: decimal(17,2)), VALUE._col5 (type: decimal(17,2)), VALUE._col6 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 812 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 812 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 812 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 7 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey2 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey0 (type: string), KEY.reducesinkkey3 (type: int), KEY.reducesinkkey4 (type: int), VALUE._col0 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: string, _col2: string, _col3: int, _col4: int, _col5: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col3 ASC NULLS LAST, _col4 ASC NULLS LAST + partition by: _col2, _col1, _col0 + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: _col3, _col4 + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: rank_window_0 is not null (type: boolean) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col2 (type: string), _col1 (type: string), _col0 (type: string), _col5 (type: decimal(17,2)), (rank_window_0 + 1) (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col4 (type: int), _col2 (type: string) + null sort order: zzzz + sort order: ++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col4 (type: int), _col2 (type: string) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(17,2)) + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: string, _col2: string, _col3: int, _col4: int, _col5: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col3 ASC NULLS LAST, _col4 ASC NULLS LAST + partition by: _col2, _col1, _col0 + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: _col3, _col4 + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: rank_window_0 is not null (type: boolean) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col2 (type: string), _col1 (type: string), _col0 (type: string), _col5 (type: decimal(17,2)), (rank_window_0 - 1) (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col4 (type: int), _col2 (type: string) + null sort order: zzzz + sort order: ++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col4 (type: int), _col2 (type: string) + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(17,2)) + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query58.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query58.q.out new file mode 100644 index 000000000000..a7afeedff489 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query58.q.out @@ -0,0 +1,425 @@ +Warning: Shuffle Join MERGEJOIN[120][tables = [$hdt$_1, $hdt$_2]] in Stage 'Reducer 8' is a cross product +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 10 <- Reducer 9 (SIMPLE_EDGE) + Reducer 11 <- Map 15 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE) + Reducer 12 <- Reducer 11 (SIMPLE_EDGE) + Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 10 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 12 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) + Reducer 8 <- Map 13 (XPROD_EDGE), Map 7 (XPROD_EDGE) + Reducer 9 <- Map 14 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_sold_date_sk", "t1"."ss_item_sk", "t1"."ss_ext_sales_price", "t4"."i_item_sk", "t4"."i_item_id", "t7"."d_date_sk", "t7"."d_date" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_item_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t2" +WHERE "i_item_sk" IS NOT NULL AND "i_item_id" IS NOT NULL) AS "t4" ON "t1"."ss_item_sk" = "t4"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t5" +WHERE "d_date" IS NOT NULL AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_date_sk" = "t7"."d_date_sk" + hive.sql.query.fieldNames ss_sold_date_sk,ss_item_sk,ss_ext_sales_price,i_item_sk,i_item_id,d_date_sk,d_date + hive.sql.query.fieldTypes int,bigint,decimal(7,2),bigint,string,int,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_ext_sales_price (type: decimal(7,2)), i_item_id (type: string), d_date (type: string) + outputColumnNames: _col2, _col4, _col6 + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col6 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col6 (type: string) + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(7,2)), _col4 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 13 + Map Operator Tree: + TableScan + alias: date_dim + properties: + hive.sql.query SELECT COUNT(*) AS "cnt" +FROM (SELECT "d_date" +FROM "date_dim") AS "t" +WHERE "d_date" = '1998-02-19' + hive.sql.query.fieldNames cnt + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cnt (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: sq_count_check(_col0) (type: boolean) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 14 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t1"."cs_sold_date_sk", "t1"."cs_item_sk", "t1"."cs_ext_sales_price", "t4"."i_item_sk", "t4"."i_item_id", "t7"."d_date_sk", "t7"."d_date" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_ext_sales_price" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_ext_sales_price" +FROM "catalog_sales") AS "t" +WHERE "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t2" +WHERE "i_item_sk" IS NOT NULL AND "i_item_id" IS NOT NULL) AS "t4" ON "t1"."cs_item_sk" = "t4"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t5" +WHERE "d_date" IS NOT NULL AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."cs_sold_date_sk" = "t7"."d_date_sk" + hive.sql.query.fieldNames cs_sold_date_sk,cs_item_sk,cs_ext_sales_price,i_item_sk,i_item_id,d_date_sk,d_date + hive.sql.query.fieldTypes int,bigint,decimal(7,2),bigint,string,int,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_ext_sales_price (type: decimal(7,2)), i_item_id (type: string), d_date (type: string) + outputColumnNames: _col2, _col4, _col6 + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col6 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col6 (type: string) + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(7,2)), _col4 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 15 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t1"."ws_sold_date_sk", "t1"."ws_item_sk", "t1"."ws_ext_sales_price", "t4"."i_item_sk", "t4"."i_item_id", "t7"."d_date_sk", "t7"."d_date" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_ext_sales_price" +FROM "web_sales") AS "t" +WHERE "ws_item_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t2" +WHERE "i_item_sk" IS NOT NULL AND "i_item_id" IS NOT NULL) AS "t4" ON "t1"."ws_item_sk" = "t4"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t5" +WHERE "d_date" IS NOT NULL AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."ws_sold_date_sk" = "t7"."d_date_sk" + hive.sql.query.fieldNames ws_sold_date_sk,ws_item_sk,ws_ext_sales_price,i_item_sk,i_item_id,d_date_sk,d_date + hive.sql.query.fieldTypes int,bigint,decimal(7,2),bigint,string,int,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_ext_sales_price (type: decimal(7,2)), i_item_id (type: string), d_date (type: string) + outputColumnNames: _col2, _col4, _col6 + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col6 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col6 (type: string) + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(7,2)), _col4 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: date_dim + properties: + hive.sql.query SELECT "t1"."d_date", "t1"."d_week_seq", "t4"."d_week_seq" AS "d_week_seq0" +FROM (SELECT "d_date", "d_week_seq" +FROM (SELECT "d_date", "d_week_seq" +FROM "date_dim") AS "t" +WHERE "d_week_seq" IS NOT NULL AND "d_date" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_week_seq" +FROM (SELECT "d_date", "d_week_seq" +FROM "date_dim") AS "t2" +WHERE "d_date" = '1998-02-19' AND "d_week_seq" IS NOT NULL) AS "t4" ON "t1"."d_week_seq" = "t4"."d_week_seq" + hive.sql.query.fieldNames d_date,d_week_seq,d_week_seq0 + hive.sql.query.fieldTypes string,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: d_date (type: string) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 10 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: decimal(17,2)), (0.9 * _col1) (type: decimal(19,3)), (1.1 * _col1) (type: decimal(20,3)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)), _col2 (type: decimal(19,3)), _col3 (type: decimal(20,3)) + Reducer 11 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col6 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col2, _col4 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col2) + keys: _col4 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 12 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: decimal(17,2)), (0.9 * _col1) (type: decimal(19,3)), (1.1 * _col1) (type: decimal(20,3)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)), _col2 (type: decimal(19,3)), _col3 (type: decimal(20,3)) + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col6 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col2, _col4 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col2) + keys: _col4 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: decimal(17,2)), (0.9 * _col1) (type: decimal(19,3)), (1.1 * _col1) (type: decimal(20,3)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)), _col2 (type: decimal(19,3)), _col3 (type: decimal(20,3)) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col5, _col6, _col7 + residual filter predicates: {_col1 BETWEEN _col6 AND _col7} {_col5 BETWEEN _col2 AND _col3} + Statistics: Num rows: 1 Data size: 580 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 580 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)), _col2 (type: decimal(19,3)), _col3 (type: decimal(20,3)), _col5 (type: decimal(17,2)), _col6 (type: decimal(19,3)), _col7 (type: decimal(20,3)) + Reducer 5 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col5, _col6, _col7, _col9, _col10, _col11 + residual filter predicates: {_col1 BETWEEN _col10 AND _col11} {_col5 BETWEEN _col10 AND _col11} {_col9 BETWEEN _col2 AND _col3} {_col9 BETWEEN _col6 AND _col7} + Statistics: Num rows: 1 Data size: 638 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: string), _col1 (type: decimal(17,2)) + null sort order: zz + Statistics: Num rows: 1 Data size: 638 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col0 (type: string), _col1 (type: decimal(17,2)), (((_col1 / ((_col1 + _col5) + _col9)) / 3) * 100) (type: decimal(38,17)), _col5 (type: decimal(17,2)), (((_col5 / ((_col1 + _col5) + _col9)) / 3) * 100) (type: decimal(38,17)), _col9 (type: decimal(17,2)), (((_col9 / ((_col1 + _col5) + _col9)) / 3) * 100) (type: decimal(38,17)), (((_col1 + _col5) + _col9) / 3) (type: decimal(23,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 638 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: decimal(17,2)) + null sort order: zz + sort order: ++ + Statistics: Num rows: 1 Data size: 638 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(38,17)), _col3 (type: decimal(17,2)), _col4 (type: decimal(38,17)), _col5 (type: decimal(17,2)), _col6 (type: decimal(38,17)), _col7 (type: decimal(23,6)) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: decimal(17,2)), VALUE._col0 (type: decimal(38,17)), VALUE._col1 (type: decimal(17,2)), VALUE._col2 (type: decimal(38,17)), VALUE._col3 (type: decimal(17,2)), VALUE._col4 (type: decimal(38,17)), VALUE._col5 (type: decimal(23,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 638 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 638 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 638 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 8 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 193 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 193 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 193 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 193 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 193 Basic stats: COMPLETE Column stats: NONE + Reducer 9 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col6 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col2, _col4 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col2) + keys: _col4 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query59.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query59.q.out new file mode 100644 index 000000000000..658f350998e1 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query59.q.out @@ -0,0 +1,61 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: date_dim + properties: + hive.sql.query SELECT "t30"."s_store_name1", "t30"."s_store_id1", "t30"."d_week_seq1", "t30"."_o__c3", "t30"."_o__c4", "t30"."_o__c5", "t30"."_o__c6", "t30"."_o__c7", "t30"."_o__c8", "t30"."_o__c9" +FROM (SELECT "t16"."s_store_name" AS "s_store_name1", "t16"."s_store_id" AS "s_store_id1", "t6"."$f0" AS "d_week_seq1", "t6"."$f2" / "t28"."$f2" AS "_o__c3", "t6"."$f3" / "t28"."$f3" AS "_o__c4", "t6"."$f4" / "t6"."$f4" AS "_o__c5", "t6"."$f5" / "t28"."$f4" AS "_o__c6", "t6"."$f6" / "t28"."$f5" AS "_o__c7", "t6"."$f7" / "t28"."$f6" AS "_o__c8", "t6"."$f8" / "t28"."$f7" AS "_o__c9" +FROM (SELECT "t1"."d_week_seq" AS "$f0", "t4"."ss_store_sk" AS "$f1", SUM(CASE WHEN "t1"."EXPR$0" THEN "t4"."ss_sales_price" ELSE NULL END) AS "$f2", SUM(CASE WHEN "t1"."EXPR$1" THEN "t4"."ss_sales_price" ELSE NULL END) AS "$f3", SUM(CASE WHEN "t1"."EXPR$2" THEN "t4"."ss_sales_price" ELSE NULL END) AS "$f4", SUM(CASE WHEN "t1"."EXPR$3" THEN "t4"."ss_sales_price" ELSE NULL END) AS "$f5", SUM(CASE WHEN "t1"."EXPR$4" THEN "t4"."ss_sales_price" ELSE NULL END) AS "$f6", SUM(CASE WHEN "t1"."EXPR$5" THEN "t4"."ss_sales_price" ELSE NULL END) AS "$f7", SUM(CASE WHEN "t1"."EXPR$6" THEN "t4"."ss_sales_price" ELSE NULL END) AS "$f8" +FROM (SELECT "d_date_sk", "d_week_seq", "d_day_name" = 'Sunday' AS "EXPR$0", "d_day_name" = 'Monday' AS "EXPR$1", "d_day_name" = 'Tuesday' AS "EXPR$2", "d_day_name" = 'Wednesday' AS "EXPR$3", "d_day_name" = 'Thursday' AS "EXPR$4", "d_day_name" = 'Friday' AS "EXPR$5", "d_day_name" = 'Saturday' AS "EXPR$6" +FROM (SELECT "d_date_sk", "d_week_seq", "d_day_name" +FROM "date_dim") AS "t" +WHERE "d_date_sk" IS NOT NULL AND "d_week_seq" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ss_sold_date_sk", "ss_store_sk", "ss_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_store_sk", "ss_sales_price" +FROM "store_sales") AS "t2" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t4" ON "t1"."d_date_sk" = "t4"."ss_sold_date_sk" +GROUP BY "t1"."d_week_seq", "t4"."ss_store_sk") AS "t6" +INNER JOIN (SELECT "d_week_seq" +FROM (SELECT "d_month_seq", "d_week_seq" +FROM "date_dim") AS "t7" +WHERE "d_month_seq" BETWEEN 1185 AND 1196 AND "d_week_seq" IS NOT NULL) AS "t9" ON "t6"."$f0" = "t9"."d_week_seq" +INNER JOIN (SELECT "t12"."s_store_sk", "t12"."s_store_id", "t12"."s_store_name", "t15"."s_store_sk" AS "s_store_sk0", "t15"."s_store_id" AS "s_store_id0" +FROM (SELECT "s_store_sk", "s_store_id", "s_store_name" +FROM (SELECT "s_store_sk", "s_store_id", "s_store_name" +FROM "store") AS "t10" +WHERE "s_store_sk" IS NOT NULL AND "s_store_id" IS NOT NULL) AS "t12" +INNER JOIN (SELECT "s_store_sk", "s_store_id" +FROM (SELECT "s_store_sk", "s_store_id" +FROM "store") AS "t13" +WHERE "s_store_sk" IS NOT NULL AND "s_store_id" IS NOT NULL) AS "t15" ON "t12"."s_store_id" = "t15"."s_store_id") AS "t16" ON "t6"."$f1" = "t16"."s_store_sk" +INNER JOIN (SELECT "t24"."$f0", "t24"."$f1", "t24"."$f2", "t24"."$f3", "t24"."$f4", "t24"."$f5", "t24"."$f6", "t24"."$f7", "t27"."d_week_seq" +FROM (SELECT "t19"."d_week_seq" AS "$f0", "t22"."ss_store_sk" AS "$f1", SUM(CASE WHEN "t19"."EXPR$0" THEN "t22"."ss_sales_price" ELSE NULL END) AS "$f2", SUM(CASE WHEN "t19"."EXPR$1" THEN "t22"."ss_sales_price" ELSE NULL END) AS "$f3", SUM(CASE WHEN "t19"."EXPR$3" THEN "t22"."ss_sales_price" ELSE NULL END) AS "$f4", SUM(CASE WHEN "t19"."EXPR$4" THEN "t22"."ss_sales_price" ELSE NULL END) AS "$f5", SUM(CASE WHEN "t19"."EXPR$5" THEN "t22"."ss_sales_price" ELSE NULL END) AS "$f6", SUM(CASE WHEN "t19"."EXPR$6" THEN "t22"."ss_sales_price" ELSE NULL END) AS "$f7" +FROM (SELECT "d_date_sk", "d_week_seq", "d_day_name" = 'Sunday' AS "EXPR$0", "d_day_name" = 'Monday' AS "EXPR$1", "d_day_name" = 'Tuesday' AS "EXPR$2", "d_day_name" = 'Wednesday' AS "EXPR$3", "d_day_name" = 'Thursday' AS "EXPR$4", "d_day_name" = 'Friday' AS "EXPR$5", "d_day_name" = 'Saturday' AS "EXPR$6" +FROM (SELECT "d_date_sk", "d_week_seq", "d_day_name" +FROM "date_dim") AS "t17" +WHERE "d_date_sk" IS NOT NULL AND "d_week_seq" IS NOT NULL) AS "t19" +INNER JOIN (SELECT "ss_sold_date_sk", "ss_store_sk", "ss_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_store_sk", "ss_sales_price" +FROM "store_sales") AS "t20" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t22" ON "t19"."d_date_sk" = "t22"."ss_sold_date_sk" +GROUP BY "t19"."d_week_seq", "t22"."ss_store_sk") AS "t24" +INNER JOIN (SELECT "d_week_seq" +FROM (SELECT "d_month_seq", "d_week_seq" +FROM "date_dim") AS "t25" +WHERE "d_month_seq" BETWEEN 1197 AND 1208 AND "d_week_seq" IS NOT NULL) AS "t27" ON "t24"."$f0" = "t27"."d_week_seq") AS "t28" ON "t6"."$f0" = "t28"."$f0" - 52 AND "t16"."s_store_sk0" = "t28"."$f1" +ORDER BY "t16"."s_store_name", "t16"."s_store_id", "t6"."$f0" +FETCH NEXT 100 ROWS ONLY) AS "t30" + hive.sql.query.fieldNames s_store_name1,s_store_id1,d_week_seq1,_o__c3,_o__c4,_o__c5,_o__c6,_o__c7,_o__c8,_o__c9 + hive.sql.query.fieldTypes string,string,int,decimal(37,20),decimal(37,20),decimal(37,20),decimal(37,20),decimal(37,20),decimal(37,20),decimal(37,20) + hive.sql.query.split false + Select Operator + expressions: s_store_name1 (type: string), s_store_id1 (type: string), d_week_seq1 (type: int), _o__c3 (type: decimal(37,20)), _o__c4 (type: decimal(37,20)), _o__c5 (type: decimal(37,20)), _o__c6 (type: decimal(37,20)), _o__c7 (type: decimal(37,20)), _o__c8 (type: decimal(37,20)), _o__c9 (type: decimal(37,20)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query6.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query6.q.out new file mode 100644 index 000000000000..1d08790587a5 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query6.q.out @@ -0,0 +1,262 @@ +Warning: Map Join MAPJOIN[51][bigTable=?] in task 'Map 2' is a cross product +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Map 2 <- Map 1 (BROADCAST_EDGE), Map 5 (BROADCAST_EDGE), Map 6 (BROADCAST_EDGE), Map 7 (BROADCAST_EDGE) + Reducer 3 <- Map 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: d + properties: + hive.sql.query SELECT "t1"."d_date_sk", "t1"."d_month_seq", "t4"."d_month_seq" AS "d_month_seq0" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM "date_dim") AS "t" +WHERE "d_date_sk" IS NOT NULL AND "d_month_seq" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_month_seq" +FROM (SELECT "d_month_seq", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2000 AND "d_moy" = 2 AND "d_month_seq" IS NOT NULL +GROUP BY "d_month_seq") AS "t4" ON "t1"."d_month_seq" = "t4"."d_month_seq" + hive.sql.query.fieldNames d_date_sk,d_month_seq,d_month_seq0 + hive.sql.query.fieldTypes int,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: d_date_sk (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 2 + Map Operator Tree: + TableScan + alias: date_dim + properties: + hive.sql.query SELECT COUNT(*) AS "cnt" +FROM (SELECT "d_month_seq" +FROM (SELECT "d_month_seq", "d_year", "d_moy" +FROM "date_dim") AS "t" +WHERE "d_year" = 2000 AND "d_moy" = 2 +GROUP BY "d_month_seq") AS "t1" + hive.sql.query.fieldNames cnt + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cnt (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: sq_count_check(_col0) (type: boolean) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Map Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0 + input vertices: + 0 Map 1 + Statistics: Num rows: 1 Data size: 13 Basic stats: COMPLETE Column stats: NONE + Map Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col5, _col6 + input vertices: + 1 Map 5 + Statistics: Num rows: 1 Data size: 14 Basic stats: COMPLETE Column stats: NONE + Map Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col5 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col6 + input vertices: + 1 Map 6 + Statistics: Num rows: 1 Data size: 15 Basic stats: COMPLETE Column stats: NONE + Map Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col6 (type: int) + 1 _col2 (type: int) + outputColumnNames: _col13 + input vertices: + 1 Map 7 + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count() + keys: _col13 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 5 + Map Operator Tree: + TableScan + alias: s + properties: + hive.sql.query SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk" +FROM "store_sales") AS "t" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL + hive.sql.query.fieldNames ss_sold_date_sk,ss_item_sk,ss_customer_sk + hive.sql.query.fieldTypes int,bigint,int + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_sold_date_sk (type: int), ss_item_sk (type: bigint), ss_customer_sk (type: int) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint), _col2 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: i + properties: + hive.sql.query SELECT "t1"."i_item_sk", "t1"."i_current_price", "t1"."i_category", "t6"."i_category" AS "i_category0", "t6"."EXPR$0" +FROM (SELECT "i_item_sk", "i_current_price", "i_category" +FROM (SELECT "i_item_sk", "i_current_price", "i_category" +FROM "item") AS "t" +WHERE "i_item_sk" IS NOT NULL AND "i_category" IS NOT NULL AND "i_current_price" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "i_category", 1.2 * CAST(CAST(SUM("i_current_price") / COUNT("i_current_price") AS DECIMAL(11, 6)) AS DECIMAL(16, 6)) AS "EXPR$0" +FROM (SELECT "i_current_price", "i_category" +FROM "item") AS "t2" +WHERE "i_category" IS NOT NULL +GROUP BY "i_category" +HAVING CAST(CAST(SUM("i_current_price") / COUNT("i_current_price") AS DECIMAL(11, 6)) AS DECIMAL(16, 6)) IS NOT NULL) AS "t6" ON "t1"."i_category" = "t6"."i_category" AND "t1"."i_current_price" > "t6"."EXPR$0" + hive.sql.query.fieldNames i_item_sk,i_current_price,i_category,i_category0,EXPR$0 + hive.sql.query.fieldTypes bigint,decimal(7,2),string,string,decimal(14,7) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_sk (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: a + properties: + hive.sql.query SELECT "t1"."ca_address_sk", "t1"."ca_state", "t4"."c_customer_sk", "t4"."c_current_addr_sk" +FROM (SELECT "ca_address_sk", "ca_state" +FROM (SELECT "ca_address_sk", "ca_state" +FROM "customer_address") AS "t" +WHERE "ca_address_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "c_customer_sk", "c_current_addr_sk" +FROM (SELECT "c_customer_sk", "c_current_addr_sk" +FROM "customer") AS "t2" +WHERE "c_current_addr_sk" IS NOT NULL AND "c_customer_sk" IS NOT NULL) AS "t4" ON "t1"."ca_address_sk" = "t4"."c_current_addr_sk" + hive.sql.query.fieldNames ca_address_sk,ca_state,c_customer_sk,c_current_addr_sk + hive.sql.query.fieldTypes int,string,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ca_state (type: string), c_customer_sk (type: int) + outputColumnNames: _col1, _col2 + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col2 (type: int) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (_col1 >= 10L) (type: boolean) + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: + + keys: _col1 (type: bigint) + null sort order: z + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Reduce Output Operator + key expressions: _col1 (type: bigint) + null sort order: z + sort order: + + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: string), KEY.reducesinkkey0 (type: bigint) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query60.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query60.q.out new file mode 100644 index 000000000000..a68e00405db6 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query60.q.out @@ -0,0 +1,387 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 10 <- Map 13 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 11 <- Reducer 10 (SIMPLE_EDGE), Union 4 (CONTAINS) + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Union 4 (CONTAINS) + Reducer 5 <- Union 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) + Reducer 8 <- Map 12 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 9 <- Reducer 8 (SIMPLE_EDGE), Union 4 (CONTAINS) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_sold_date_sk", "t1"."ss_item_sk", "t1"."ss_addr_sk", "t1"."ss_ext_sales_price", "t10"."d_date_sk", "t10"."d_year", "t10"."d_moy", "t4"."ca_address_sk", "t4"."ca_gmt_offset", "t7"."i_item_sk", "t7"."i_item_id" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_addr_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_addr_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_addr_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_gmt_offset" +FROM (SELECT "ca_address_sk", "ca_gmt_offset" +FROM "customer_address") AS "t2" +WHERE "ca_gmt_offset" = -6 AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."ss_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t5" +WHERE "i_item_id" IS NOT NULL AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t8" +WHERE "d_year" = 1999 AND "d_moy" = 9 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."ss_sold_date_sk" = "t10"."d_date_sk" + hive.sql.query.fieldNames ss_sold_date_sk,ss_item_sk,ss_addr_sk,ss_ext_sales_price,d_date_sk,d_year,d_moy,ca_address_sk,ca_gmt_offset,i_item_sk,i_item_id + hive.sql.query.fieldTypes int,bigint,int,decimal(7,2),int,int,int,int,decimal(5,2),bigint,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_ext_sales_price (type: decimal(7,2)), i_item_id (type: string) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col10 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col10 (type: string) + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 12 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t1"."cs_sold_date_sk", "t1"."cs_bill_addr_sk", "t1"."cs_item_sk", "t1"."cs_ext_sales_price", "t10"."d_date_sk", "t10"."d_year", "t10"."d_moy", "t4"."ca_address_sk", "t4"."ca_gmt_offset", "t7"."i_item_sk", "t7"."i_item_id" +FROM (SELECT "cs_sold_date_sk", "cs_bill_addr_sk", "cs_item_sk", "cs_ext_sales_price" +FROM (SELECT "cs_sold_date_sk", "cs_bill_addr_sk", "cs_item_sk", "cs_ext_sales_price" +FROM "catalog_sales") AS "t" +WHERE "cs_sold_date_sk" IS NOT NULL AND "cs_bill_addr_sk" IS NOT NULL AND "cs_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_gmt_offset" +FROM (SELECT "ca_address_sk", "ca_gmt_offset" +FROM "customer_address") AS "t2" +WHERE "ca_gmt_offset" = -6 AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."cs_bill_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t5" +WHERE "i_item_id" IS NOT NULL AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."cs_item_sk" = "t7"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t8" +WHERE "d_year" = 1999 AND "d_moy" = 9 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."cs_sold_date_sk" = "t10"."d_date_sk" + hive.sql.query.fieldNames cs_sold_date_sk,cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price,d_date_sk,d_year,d_moy,ca_address_sk,ca_gmt_offset,i_item_sk,i_item_id + hive.sql.query.fieldTypes int,int,bigint,decimal(7,2),int,int,int,int,decimal(5,2),bigint,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_ext_sales_price (type: decimal(7,2)), i_item_id (type: string) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col10 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col10 (type: string) + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 13 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t1"."ws_sold_date_sk", "t1"."ws_item_sk", "t1"."ws_bill_addr_sk", "t1"."ws_ext_sales_price", "t10"."d_date_sk", "t10"."d_year", "t10"."d_moy", "t4"."ca_address_sk", "t4"."ca_gmt_offset", "t7"."i_item_sk", "t7"."i_item_id" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_addr_sk", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_addr_sk", "ws_ext_sales_price" +FROM "web_sales") AS "t" +WHERE "ws_sold_date_sk" IS NOT NULL AND "ws_bill_addr_sk" IS NOT NULL AND "ws_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_gmt_offset" +FROM (SELECT "ca_address_sk", "ca_gmt_offset" +FROM "customer_address") AS "t2" +WHERE "ca_gmt_offset" = -6 AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."ws_bill_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t5" +WHERE "i_item_id" IS NOT NULL AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ws_item_sk" = "t7"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t8" +WHERE "d_year" = 1999 AND "d_moy" = 9 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."ws_sold_date_sk" = "t10"."d_date_sk" + hive.sql.query.fieldNames ws_sold_date_sk,ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price,d_date_sk,d_year,d_moy,ca_address_sk,ca_gmt_offset,i_item_sk,i_item_id + hive.sql.query.fieldTypes int,bigint,int,decimal(7,2),int,int,int,int,decimal(5,2),bigint,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_ext_sales_price (type: decimal(7,2)), i_item_id (type: string) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col10 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col10 (type: string) + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: item + properties: + hive.sql.query SELECT "i_item_id" +FROM (SELECT "i_item_id", "i_category" +FROM "item") AS "t" +WHERE "i_category" = 'Children' AND "i_item_id" IS NOT NULL + hive.sql.query.fieldNames i_item_id + hive.sql.query.fieldTypes string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_id (type: string) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 10 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col10 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3) + keys: _col10 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 11 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: + + keys: _col0 (type: string) + null sort order: z + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col1) + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(27,2)) + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col10 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3) + keys: _col10 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: + + keys: _col0 (type: string) + null sort order: z + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col1) + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(27,2)) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: string), _col1 (type: decimal(27,2)) + null sort order: zz + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: decimal(27,2)) + null sort order: zz + sort order: ++ + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: decimal(27,2)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 8 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col10 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col3, _col10 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3) + keys: _col10 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 9 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 325 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: + + keys: _col0 (type: string) + null sort order: z + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col1) + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 3 Data size: 975 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(27,2)) + Union 4 + Vertex: Union 4 + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query61.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query61.q.out new file mode 100644 index 000000000000..7b79273d327e --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query61.q.out @@ -0,0 +1,138 @@ +Warning: Shuffle Join MERGEJOIN[9][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (XPROD_EDGE), Map 3 (XPROD_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT SUM("t1"."ss_ext_sales_price") AS "$f0" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_promo_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_promo_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_store_sk" IS NOT NULL AND "ss_promo_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_gmt_offset" +FROM "store") AS "t2" +WHERE "s_gmt_offset" = -7 AND "s_store_sk" IS NOT NULL) AS "t4" ON "t1"."ss_store_sk" = "t4"."s_store_sk" +INNER JOIN (SELECT "p_promo_sk" +FROM (SELECT "p_promo_sk", "p_channel_dmail", "p_channel_email", "p_channel_tv" +FROM "promotion") AS "t5" +WHERE ("p_channel_dmail" = 'Y' OR "p_channel_email" = 'Y' OR "p_channel_tv" = 'Y') AND "p_promo_sk" IS NOT NULL) AS "t7" ON "t1"."ss_promo_sk" = "t7"."p_promo_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t8" +WHERE "d_year" = 1999 AND "d_moy" = 11 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."ss_sold_date_sk" = "t10"."d_date_sk" +INNER JOIN (SELECT "i_item_sk" +FROM (SELECT "i_item_sk", "i_category" +FROM "item") AS "t11" +WHERE "i_category" = 'Electronics' AND "i_item_sk" IS NOT NULL) AS "t13" ON "t1"."ss_item_sk" = "t13"."i_item_sk" +INNER JOIN (SELECT "t16"."c_customer_sk", "t16"."c_current_addr_sk", "t19"."ca_address_sk" +FROM (SELECT "c_customer_sk", "c_current_addr_sk" +FROM (SELECT "c_customer_sk", "c_current_addr_sk" +FROM "customer") AS "t14" +WHERE "c_customer_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL) AS "t16" +INNER JOIN (SELECT "ca_address_sk" +FROM (SELECT "ca_address_sk", "ca_gmt_offset" +FROM "customer_address") AS "t17" +WHERE "ca_gmt_offset" = -7 AND "ca_address_sk" IS NOT NULL) AS "t19" ON "t16"."c_current_addr_sk" = "t19"."ca_address_sk") AS "t20" ON "t1"."ss_customer_sk" = "t20"."c_customer_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: decimal(17,2)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 3 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT SUM("t1"."ss_ext_sales_price") AS "$f0" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_store_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_store_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_gmt_offset" +FROM "store") AS "t2" +WHERE "s_gmt_offset" = -7 AND "s_store_sk" IS NOT NULL) AS "t4" ON "t1"."ss_store_sk" = "t4"."s_store_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t5" +WHERE "d_year" = 1999 AND "d_moy" = 11 AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_date_sk" = "t7"."d_date_sk" +INNER JOIN (SELECT "i_item_sk" +FROM (SELECT "i_item_sk", "i_category" +FROM "item") AS "t8" +WHERE "i_category" = 'Electronics' AND "i_item_sk" IS NOT NULL) AS "t10" ON "t1"."ss_item_sk" = "t10"."i_item_sk" +INNER JOIN (SELECT "t13"."c_customer_sk", "t13"."c_current_addr_sk", "t16"."ca_address_sk" +FROM (SELECT "c_customer_sk", "c_current_addr_sk" +FROM (SELECT "c_customer_sk", "c_current_addr_sk" +FROM "customer") AS "t11" +WHERE "c_customer_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL) AS "t13" +INNER JOIN (SELECT "ca_address_sk" +FROM (SELECT "ca_address_sk", "ca_gmt_offset" +FROM "customer_address") AS "t14" +WHERE "ca_gmt_offset" = -7 AND "ca_address_sk" IS NOT NULL) AS "t16" ON "t13"."c_current_addr_sk" = "t16"."ca_address_sk") AS "t17" ON "t1"."ss_customer_sk" = "t17"."c_customer_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: decimal(17,2)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 225 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: decimal(17,2)), _col1 (type: decimal(17,2)), ((CAST( _col0 AS decimal(15,4)) / CAST( _col1 AS decimal(15,4))) * 100) (type: decimal(38,19)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 225 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 225 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query62.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query62.q.out new file mode 100644 index 000000000000..2d79355744bb --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query62.q.out @@ -0,0 +1,235 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Map 9 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t1"."ws_ship_date_sk", "t1"."ws_web_site_sk", "t1"."ws_ship_mode_sk", "t1"."ws_warehouse_sk", "t1"."$f3", "t1"."$f4", "t1"."$f5", "t1"."$f6", "t1"."$f7", "t4"."d_date_sk" +FROM (SELECT "ws_ship_date_sk", "ws_web_site_sk", "ws_ship_mode_sk", "ws_warehouse_sk", CASE WHEN "ws_ship_date_sk" - "ws_sold_date_sk" <= 30 THEN 1 ELSE 0 END AS "$f3", CASE WHEN "ws_ship_date_sk" - "ws_sold_date_sk" > 30 AND "ws_ship_date_sk" - "ws_sold_date_sk" <= 60 THEN 1 ELSE 0 END AS "$f4", CASE WHEN "ws_ship_date_sk" - "ws_sold_date_sk" > 60 AND "ws_ship_date_sk" - "ws_sold_date_sk" <= 90 THEN 1 ELSE 0 END AS "$f5", CASE WHEN "ws_ship_date_sk" - "ws_sold_date_sk" > 90 AND "ws_ship_date_sk" - "ws_sold_date_sk" <= 120 THEN 1 ELSE 0 END AS "$f6", CASE WHEN "ws_ship_date_sk" - "ws_sold_date_sk" > 120 THEN 1 ELSE 0 END AS "$f7" +FROM (SELECT "ws_sold_date_sk", "ws_ship_date_sk", "ws_web_site_sk", "ws_ship_mode_sk", "ws_warehouse_sk" +FROM "web_sales") AS "t" +WHERE "ws_warehouse_sk" IS NOT NULL AND "ws_ship_mode_sk" IS NOT NULL AND "ws_web_site_sk" IS NOT NULL AND "ws_ship_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM "date_dim") AS "t2" +WHERE "d_month_seq" BETWEEN 1215 AND 1226 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_ship_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames ws_ship_date_sk,ws_web_site_sk,ws_ship_mode_sk,ws_warehouse_sk,$f3,$f4,$f5,$f6,$f7,d_date_sk + hive.sql.query.fieldTypes int,int,int,int,int,int,int,int,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 32 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_web_site_sk (type: int), ws_ship_mode_sk (type: int), ws_warehouse_sk (type: int), $f3 (type: int), $f4 (type: int), $f5 (type: int), $f6 (type: int), $f7 (type: int) + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 1 Data size: 32 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col3 (type: int) + Statistics: Num rows: 1 Data size: 32 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col2 (type: int), _col4 (type: int), _col5 (type: int), _col6 (type: int), _col7 (type: int), _col8 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: warehouse + properties: + hive.sql.query SELECT "w_warehouse_sk", "w_warehouse_name" +FROM (SELECT "w_warehouse_sk", "w_warehouse_name" +FROM "warehouse") AS "t" +WHERE "w_warehouse_sk" IS NOT NULL + hive.sql.query.fieldNames w_warehouse_sk,w_warehouse_name + hive.sql.query.fieldTypes int,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: w_warehouse_sk (type: int), substr(w_warehouse_name, 1, 20) (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 8 + Map Operator Tree: + TableScan + alias: ship_mode + properties: + hive.sql.query SELECT "sm_ship_mode_sk", "sm_type" +FROM (SELECT "sm_ship_mode_sk", "sm_type" +FROM "ship_mode") AS "t" +WHERE "sm_ship_mode_sk" IS NOT NULL + hive.sql.query.fieldNames sm_ship_mode_sk,sm_type + hive.sql.query.fieldTypes int,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: sm_ship_mode_sk (type: int), sm_type (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: web_site + properties: + hive.sql.query SELECT "web_site_sk", "web_name" +FROM (SELECT "web_site_sk", "web_name" +FROM "web_site") AS "t" +WHERE "web_site_sk" IS NOT NULL + hive.sql.query.fieldNames web_site_sk,web_name + hive.sql.query.fieldTypes int,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: web_site_sk (type: int), web_name (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col3 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col1, _col2, _col4, _col5, _col6, _col7, _col8, _col11 + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col2 (type: int) + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col4 (type: int), _col5 (type: int), _col6 (type: int), _col7 (type: int), _col8 (type: int), _col11 (type: string) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col2 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col1, _col4, _col5, _col6, _col7, _col8, _col11, _col13 + Statistics: Num rows: 1 Data size: 38 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 38 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: int), _col5 (type: int), _col6 (type: int), _col7 (type: int), _col8 (type: int), _col11 (type: string), _col13 (type: string) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col1 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col4, _col5, _col6, _col7, _col8, _col11, _col13, _col15 + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +++ + keys: _col11 (type: string), _col13 (type: string), _col15 (type: string) + null sort order: zzz + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col4), sum(_col5), sum(_col6), sum(_col7), sum(_col8) + keys: _col11 (type: string), _col13 (type: string), _col15 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string) + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint), _col4 (type: bigint), _col5 (type: bigint), _col6 (type: bigint), _col7 (type: bigint) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1), sum(VALUE._col2), sum(VALUE._col3), sum(VALUE._col4) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col1 (type: string), _col2 (type: string), _col3 (type: bigint), _col4 (type: bigint), _col5 (type: bigint), _col6 (type: bigint), _col7 (type: bigint), _col0 (type: string) + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col8 (type: string), _col1 (type: string), _col2 (type: string) + null sort order: zzz + sort order: +++ + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint), _col4 (type: bigint), _col5 (type: bigint), _col6 (type: bigint), _col7 (type: bigint) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), VALUE._col0 (type: bigint), VALUE._col1 (type: bigint), VALUE._col2 (type: bigint), VALUE._col3 (type: bigint), VALUE._col4 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query63.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query63.q.out new file mode 100644 index 000000000000..e37576f56b9d --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query63.q.out @@ -0,0 +1,126 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t7"."i_manager_id", "t10"."d_moy", SUM("t1"."ss_sales_price") AS "$f2" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_item_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk" +FROM "store") AS "t2" +WHERE "s_store_sk" IS NOT NULL) AS "t4" ON "t1"."ss_store_sk" = "t4"."s_store_sk" +INNER JOIN (SELECT "i_item_sk", "i_manager_id" +FROM (SELECT "i_item_sk", "i_brand", "i_class", "i_category", "i_manager_id" +FROM "item") AS "t5" +WHERE ("i_category" IN ('Books', 'Children', 'Electronics') AND "i_class" IN ('personal', 'portable', 'refernece', 'self-help') AND "i_brand" IN ('exportiunivamalg #9', 'scholaramalgamalg #14', 'scholaramalgamalg #7', 'scholaramalgamalg #9') OR "i_category" IN ('Men', 'Music', 'Women') AND "i_class" IN ('accessories', 'classical', 'fragrances', 'pants') AND "i_brand" IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')) AND "i_class" IN ('accessories', 'classical', 'fragrances', 'pants', 'personal', 'portable', 'refernece', 'self-help') AND "i_brand" IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'exportiunivamalg #9', 'importoamalg #1', 'scholaramalgamalg #14', 'scholaramalgamalg #7', 'scholaramalgamalg #9') AND "i_category" IN ('Books', 'Children', 'Electronics', 'Men', 'Music', 'Women') AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_moy" +FROM (SELECT "d_date_sk", "d_month_seq", "d_moy" +FROM "date_dim") AS "t8" +WHERE "d_month_seq" IN (1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223) AND "d_date_sk" IS NOT NULL) AS "t10" ON "t1"."ss_sold_date_sk" = "t10"."d_date_sk" +GROUP BY "t7"."i_manager_id", "t10"."d_moy" + hive.sql.query.fieldNames i_manager_id,d_moy,$f2 + hive.sql.query.fieldTypes int,int,decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_manager_id (type: int), $f2 (type: decimal(17,2)) + outputColumnNames: _col0, _col2 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: a + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: int), VALUE._col1 (type: decimal(17,2)) + outputColumnNames: _col0, _col2 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: int, _col2: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col0 ASC NULLS FIRST + partition by: _col0 + raw input shape: + window functions: + window function definition + alias: avg_window_0 + arguments: _col2 + name: avg + window function: GenericUDAFAverageEvaluatorDecimal + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: avg_window_0 (type: decimal(21,6)), _col0 (type: int), _col2 (type: decimal(17,2)) + outputColumnNames: avg_window_0, _col0, _col2 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: if((avg_window_0 > 0), ((abs((_col2 - avg_window_0)) / avg_window_0) > 0.1), false) (type: boolean) + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +++ + keys: _col0 (type: int), avg_window_0 (type: decimal(21,6)), _col2 (type: decimal(17,2)) + null sort order: zzz + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col0 (type: int), _col2 (type: decimal(17,2)), avg_window_0 (type: decimal(21,6)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col2 (type: decimal(21,6)), _col1 (type: decimal(17,2)) + null sort order: zzz + sort order: +++ + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: int), KEY.reducesinkkey2 (type: decimal(17,2)), KEY.reducesinkkey1 (type: decimal(21,6)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query64.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query64.q.out new file mode 100644 index 000000000000..e39f50967378 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query64.q.out @@ -0,0 +1,194 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t134"."product_name", "t134"."store_name", "t134"."store_zip", "t134"."b_street_number", "t134"."b_streen_name", "t134"."b_city", "t134"."b_zip", "t134"."c_street_number", "t134"."c_street_name", "t134"."c_city", "t134"."c_zip", CAST(2000 AS INTEGER) AS "syear", "t134"."cnt", "t134"."s1", "t134"."s2", "t134"."s3", "t134"."s11", "t134"."s21", "t134"."s31", CAST(2001 AS INTEGER) AS "syear1", "t134"."cnt1" +FROM (SELECT "t65"."$f0" AS "product_name", "t65"."$f2" AS "store_name", "t65"."$f3" AS "store_zip", "t65"."$f4" AS "b_street_number", "t65"."$f5" AS "b_streen_name", "t65"."$f6" AS "b_city", "t65"."$f7" AS "b_zip", "t65"."$f8" AS "c_street_number", "t65"."$f9" AS "c_street_name", "t65"."$f10" AS "c_city", "t65"."$f11" AS "c_zip", "t65"."$f15" AS "cnt", "t65"."$f16" AS "s1", "t65"."$f17" AS "s2", "t65"."$f18" AS "s3", "t132"."$f16" AS "s11", "t132"."$f17" AS "s21", "t132"."$f18" AS "s31", "t132"."$f15" AS "cnt1" +FROM (SELECT "i_product_name" AS "$f0", "i_item_sk" AS "$f1", "s_store_name" AS "$f2", "s_zip" AS "$f3", "ca_street_number" AS "$f4", "ca_street_name" AS "$f5", "ca_city" AS "$f6", "ca_zip" AS "$f7", "ca_street_number0" AS "$f8", "ca_street_name0" AS "$f9", "ca_city0" AS "$f10", "ca_zip0" AS "$f11", "$f14" AS "$f15", "$f15" AS "$f16", "$f16" AS "$f17", "$f17" AS "$f18" +FROM (SELECT "t22"."i_product_name", "t22"."i_item_sk", "t32"."s_store_name", "t32"."s_zip", "t35"."ca_street_number", "t35"."ca_street_name", "t35"."ca_city", "t35"."ca_zip", "t58"."ca_street_number" AS "ca_street_number0", "t58"."ca_street_name" AS "ca_street_name0", "t58"."ca_city" AS "ca_city0", "t58"."ca_zip" AS "ca_zip0", "t58"."d_year", "t58"."d_year0", COUNT(*) AS "$f14", SUM("t1"."ss_wholesale_cost") AS "$f15", SUM("t1"."ss_list_price") AS "$f16", SUM("t1"."ss_coupon_amt") AS "$f17" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_cdemo_sk", "ss_hdemo_sk", "ss_addr_sk", "ss_store_sk", "ss_promo_sk", "ss_ticket_number", "ss_wholesale_cost", "ss_list_price", "ss_coupon_amt" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_cdemo_sk", "ss_hdemo_sk", "ss_addr_sk", "ss_store_sk", "ss_promo_sk", "ss_ticket_number", "ss_wholesale_cost", "ss_list_price", "ss_coupon_amt" +FROM "store_sales") AS "t" +WHERE "ss_item_sk" IS NOT NULL AND "ss_ticket_number" IS NOT NULL AND ("ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AND ("ss_customer_sk" IS NOT NULL AND "ss_cdemo_sk" IS NOT NULL AND ("ss_promo_sk" IS NOT NULL AND ("ss_hdemo_sk" IS NOT NULL AND "ss_addr_sk" IS NOT NULL)))) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "p_promo_sk" +FROM (SELECT "p_promo_sk" +FROM "promotion") AS "t5" +WHERE "p_promo_sk" IS NOT NULL) AS "t7" ON "t1"."ss_promo_sk" = "t7"."p_promo_sk" +INNER JOIN (SELECT "sr_item_sk", "sr_ticket_number" +FROM (SELECT "sr_item_sk", "sr_ticket_number" +FROM "store_returns") AS "t8" +WHERE "sr_item_sk" IS NOT NULL AND "sr_ticket_number" IS NOT NULL) AS "t10" ON "t1"."ss_item_sk" = "t10"."sr_item_sk" AND "t1"."ss_ticket_number" = "t10"."sr_ticket_number" +INNER JOIN (SELECT "t13"."cs_item_sk" AS "$f0" +FROM (SELECT "cs_item_sk", "cs_order_number", "cs_ext_list_price" +FROM (SELECT "cs_item_sk", "cs_order_number", "cs_ext_list_price" +FROM "catalog_sales") AS "t11" +WHERE "cs_item_sk" IS NOT NULL AND "cs_order_number" IS NOT NULL) AS "t13" +INNER JOIN (SELECT "cr_item_sk", "cr_order_number", "cr_refunded_cash" + "cr_reversed_charge" + "cr_store_credit" AS "$f2" +FROM (SELECT "cr_item_sk", "cr_order_number", "cr_refunded_cash", "cr_reversed_charge", "cr_store_credit" +FROM "catalog_returns") AS "t14" +WHERE "cr_item_sk" IS NOT NULL AND "cr_order_number" IS NOT NULL) AS "t16" ON "t13"."cs_item_sk" = "t16"."cr_item_sk" AND "t13"."cs_order_number" = "t16"."cr_order_number" +GROUP BY "t13"."cs_item_sk" +HAVING SUM("t13"."cs_ext_list_price") > 2 * SUM("t16"."$f2")) AS "t19" ON "t1"."ss_item_sk" = "t19"."$f0" +INNER JOIN (SELECT "i_item_sk", "i_product_name" +FROM (SELECT "i_item_sk", "i_current_price", "i_color", "i_product_name" +FROM "item") AS "t20" +WHERE "i_color" IN ('burnished', 'chocolate', 'dim', 'maroon', 'navajo', 'steel') AND "i_current_price" BETWEEN 36 AND 45 AND "i_item_sk" IS NOT NULL) AS "t22" ON "t1"."ss_item_sk" = "t22"."i_item_sk" +INNER JOIN (SELECT "t25"."hd_demo_sk", "t25"."hd_income_band_sk", "t28"."ib_income_band_sk" +FROM (SELECT "hd_demo_sk", "hd_income_band_sk" +FROM (SELECT "hd_demo_sk", "hd_income_band_sk" +FROM "household_demographics") AS "t23" +WHERE "hd_demo_sk" IS NOT NULL AND "hd_income_band_sk" IS NOT NULL) AS "t25" +INNER JOIN (SELECT "ib_income_band_sk" +FROM (SELECT "ib_income_band_sk" +FROM "income_band") AS "t26" +WHERE "ib_income_band_sk" IS NOT NULL) AS "t28" ON "t25"."hd_income_band_sk" = "t28"."ib_income_band_sk") AS "t29" ON "t1"."ss_hdemo_sk" = "t29"."hd_demo_sk" +INNER JOIN (SELECT "s_store_sk", "s_store_name", "s_zip" +FROM (SELECT "s_store_sk", "s_store_name", "s_zip" +FROM "store") AS "t30" +WHERE "s_store_sk" IS NOT NULL AND "s_store_name" IS NOT NULL AND "s_zip" IS NOT NULL) AS "t32" ON "t1"."ss_store_sk" = "t32"."s_store_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_street_number", "ca_street_name", "ca_city", "ca_zip" +FROM (SELECT "ca_address_sk", "ca_street_number", "ca_street_name", "ca_city", "ca_zip" +FROM "customer_address") AS "t33" +WHERE "ca_address_sk" IS NOT NULL) AS "t35" ON "t1"."ss_addr_sk" = "t35"."ca_address_sk" +INNER JOIN (SELECT "t38"."c_customer_sk", "t38"."c_current_cdemo_sk", "t38"."c_current_hdemo_sk", "t38"."c_current_addr_sk", "t38"."c_first_shipto_date_sk", "t38"."c_first_sales_date_sk", "t41"."cd_demo_sk", "t41"."cd_marital_status", "t44"."d_date_sk", "t44"."d_year", "t47"."d_date_sk" AS "d_date_sk0", "t47"."d_year" AS "d_year0", "t54"."hd_demo_sk", "t54"."hd_income_band_sk", "t54"."ib_income_band_sk", "t57"."ca_address_sk", "t57"."ca_street_number", "t57"."ca_street_name", "t57"."ca_city", "t57"."ca_zip" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_hdemo_sk", "c_current_addr_sk", "c_first_shipto_date_sk", "c_first_sales_date_sk" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_hdemo_sk", "c_current_addr_sk", "c_first_shipto_date_sk", "c_first_sales_date_sk" +FROM "customer") AS "t36" +WHERE "c_customer_sk" IS NOT NULL AND ("c_first_sales_date_sk" IS NOT NULL AND "c_first_shipto_date_sk" IS NOT NULL) AND ("c_current_cdemo_sk" IS NOT NULL AND ("c_current_hdemo_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL))) AS "t38" +INNER JOIN (SELECT "cd_demo_sk", "cd_marital_status" +FROM (SELECT "cd_demo_sk", "cd_marital_status" +FROM "customer_demographics") AS "t39" +WHERE "cd_demo_sk" IS NOT NULL) AS "t41" ON "t38"."c_current_cdemo_sk" = "t41"."cd_demo_sk" +INNER JOIN (SELECT "d_date_sk", "d_year" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t42" +WHERE "d_date_sk" IS NOT NULL) AS "t44" ON "t38"."c_first_sales_date_sk" = "t44"."d_date_sk" +INNER JOIN (SELECT "d_date_sk", "d_year" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t45" +WHERE "d_date_sk" IS NOT NULL) AS "t47" ON "t38"."c_first_shipto_date_sk" = "t47"."d_date_sk" +INNER JOIN (SELECT "t50"."hd_demo_sk", "t50"."hd_income_band_sk", "t53"."ib_income_band_sk" +FROM (SELECT "hd_demo_sk", "hd_income_band_sk" +FROM (SELECT "hd_demo_sk", "hd_income_band_sk" +FROM "household_demographics") AS "t48" +WHERE "hd_demo_sk" IS NOT NULL AND "hd_income_band_sk" IS NOT NULL) AS "t50" +INNER JOIN (SELECT "ib_income_band_sk" +FROM (SELECT "ib_income_band_sk" +FROM "income_band") AS "t51" +WHERE "ib_income_band_sk" IS NOT NULL) AS "t53" ON "t50"."hd_income_band_sk" = "t53"."ib_income_band_sk") AS "t54" ON "t38"."c_current_hdemo_sk" = "t54"."hd_demo_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_street_number", "ca_street_name", "ca_city", "ca_zip" +FROM (SELECT "ca_address_sk", "ca_street_number", "ca_street_name", "ca_city", "ca_zip" +FROM "customer_address") AS "t55" +WHERE "ca_address_sk" IS NOT NULL) AS "t57" ON "t38"."c_current_addr_sk" = "t57"."ca_address_sk") AS "t58" ON "t1"."ss_customer_sk" = "t58"."c_customer_sk" +INNER JOIN (SELECT "cd_demo_sk", "cd_marital_status" +FROM (SELECT "cd_demo_sk", "cd_marital_status" +FROM "customer_demographics") AS "t59" +WHERE "cd_demo_sk" IS NOT NULL) AS "t61" ON "t58"."cd_marital_status" <> "t61"."cd_marital_status" AND "t1"."ss_cdemo_sk" = "t61"."cd_demo_sk" +GROUP BY "t22"."i_item_sk", "t22"."i_product_name", "t32"."s_store_name", "t32"."s_zip", "t35"."ca_street_number", "t35"."ca_street_name", "t35"."ca_city", "t35"."ca_zip", "t58"."d_year", "t58"."d_year0", "t58"."ca_street_number", "t58"."ca_street_name", "t58"."ca_city", "t58"."ca_zip") AS "t63" +WHERE "t63"."$f14" IS NOT NULL) AS "t65" +INNER JOIN (SELECT "i_item_sk" AS "$f1", "s_store_name" AS "$f2", "s_zip" AS "$f3", "$f14" AS "$f15", "$f15" AS "$f16", "$f16" AS "$f17", "$f17" AS "$f18" +FROM (SELECT "t89"."i_product_name", "t89"."i_item_sk", "t99"."s_store_name", "t99"."s_zip", "t102"."ca_street_number", "t102"."ca_street_name", "t102"."ca_city", "t102"."ca_zip", "t125"."ca_street_number" AS "ca_street_number0", "t125"."ca_street_name" AS "ca_street_name0", "t125"."ca_city" AS "ca_city0", "t125"."ca_zip" AS "ca_zip0", "t125"."d_year", "t125"."d_year0", COUNT(*) AS "$f14", SUM("t68"."ss_wholesale_cost") AS "$f15", SUM("t68"."ss_list_price") AS "$f16", SUM("t68"."ss_coupon_amt") AS "$f17" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_cdemo_sk", "ss_hdemo_sk", "ss_addr_sk", "ss_store_sk", "ss_promo_sk", "ss_ticket_number", "ss_wholesale_cost", "ss_list_price", "ss_coupon_amt" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_cdemo_sk", "ss_hdemo_sk", "ss_addr_sk", "ss_store_sk", "ss_promo_sk", "ss_ticket_number", "ss_wholesale_cost", "ss_list_price", "ss_coupon_amt" +FROM "store_sales") AS "t66" +WHERE "ss_item_sk" IS NOT NULL AND "ss_ticket_number" IS NOT NULL AND ("ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AND ("ss_customer_sk" IS NOT NULL AND "ss_cdemo_sk" IS NOT NULL AND ("ss_promo_sk" IS NOT NULL AND ("ss_hdemo_sk" IS NOT NULL AND "ss_addr_sk" IS NOT NULL)))) AS "t68" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t69" +WHERE "d_year" = 2001 AND "d_date_sk" IS NOT NULL) AS "t71" ON "t68"."ss_sold_date_sk" = "t71"."d_date_sk" +INNER JOIN (SELECT "p_promo_sk" +FROM (SELECT "p_promo_sk" +FROM "promotion") AS "t72" +WHERE "p_promo_sk" IS NOT NULL) AS "t74" ON "t68"."ss_promo_sk" = "t74"."p_promo_sk" +INNER JOIN (SELECT "sr_item_sk", "sr_ticket_number" +FROM (SELECT "sr_item_sk", "sr_ticket_number" +FROM "store_returns") AS "t75" +WHERE "sr_item_sk" IS NOT NULL AND "sr_ticket_number" IS NOT NULL) AS "t77" ON "t68"."ss_item_sk" = "t77"."sr_item_sk" AND "t68"."ss_ticket_number" = "t77"."sr_ticket_number" +INNER JOIN (SELECT "t80"."cs_item_sk" AS "$f0" +FROM (SELECT "cs_item_sk", "cs_order_number", "cs_ext_list_price" +FROM (SELECT "cs_item_sk", "cs_order_number", "cs_ext_list_price" +FROM "catalog_sales") AS "t78" +WHERE "cs_item_sk" IS NOT NULL AND "cs_order_number" IS NOT NULL) AS "t80" +INNER JOIN (SELECT "cr_item_sk", "cr_order_number", "cr_refunded_cash" + "cr_reversed_charge" + "cr_store_credit" AS "$f2" +FROM (SELECT "cr_item_sk", "cr_order_number", "cr_refunded_cash", "cr_reversed_charge", "cr_store_credit" +FROM "catalog_returns") AS "t81" +WHERE "cr_item_sk" IS NOT NULL AND "cr_order_number" IS NOT NULL) AS "t83" ON "t80"."cs_item_sk" = "t83"."cr_item_sk" AND "t80"."cs_order_number" = "t83"."cr_order_number" +GROUP BY "t80"."cs_item_sk" +HAVING SUM("t80"."cs_ext_list_price") > 2 * SUM("t83"."$f2")) AS "t86" ON "t68"."ss_item_sk" = "t86"."$f0" +INNER JOIN (SELECT "i_item_sk", "i_product_name" +FROM (SELECT "i_item_sk", "i_current_price", "i_color", "i_product_name" +FROM "item") AS "t87" +WHERE "i_color" IN ('burnished', 'chocolate', 'dim', 'maroon', 'navajo', 'steel') AND "i_current_price" BETWEEN 36 AND 45 AND "i_item_sk" IS NOT NULL) AS "t89" ON "t68"."ss_item_sk" = "t89"."i_item_sk" +INNER JOIN (SELECT "t92"."hd_demo_sk", "t92"."hd_income_band_sk", "t95"."ib_income_band_sk" +FROM (SELECT "hd_demo_sk", "hd_income_band_sk" +FROM (SELECT "hd_demo_sk", "hd_income_band_sk" +FROM "household_demographics") AS "t90" +WHERE "hd_demo_sk" IS NOT NULL AND "hd_income_band_sk" IS NOT NULL) AS "t92" +INNER JOIN (SELECT "ib_income_band_sk" +FROM (SELECT "ib_income_band_sk" +FROM "income_band") AS "t93" +WHERE "ib_income_band_sk" IS NOT NULL) AS "t95" ON "t92"."hd_income_band_sk" = "t95"."ib_income_band_sk") AS "t96" ON "t68"."ss_hdemo_sk" = "t96"."hd_demo_sk" +INNER JOIN (SELECT "s_store_sk", "s_store_name", "s_zip" +FROM (SELECT "s_store_sk", "s_store_name", "s_zip" +FROM "store") AS "t97" +WHERE "s_store_sk" IS NOT NULL AND "s_store_name" IS NOT NULL AND "s_zip" IS NOT NULL) AS "t99" ON "t68"."ss_store_sk" = "t99"."s_store_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_street_number", "ca_street_name", "ca_city", "ca_zip" +FROM (SELECT "ca_address_sk", "ca_street_number", "ca_street_name", "ca_city", "ca_zip" +FROM "customer_address") AS "t100" +WHERE "ca_address_sk" IS NOT NULL) AS "t102" ON "t68"."ss_addr_sk" = "t102"."ca_address_sk" +INNER JOIN (SELECT "t105"."c_customer_sk", "t105"."c_current_cdemo_sk", "t105"."c_current_hdemo_sk", "t105"."c_current_addr_sk", "t105"."c_first_shipto_date_sk", "t105"."c_first_sales_date_sk", "t108"."cd_demo_sk", "t108"."cd_marital_status", "t111"."d_date_sk", "t111"."d_year", "t114"."d_date_sk" AS "d_date_sk0", "t114"."d_year" AS "d_year0", "t121"."hd_demo_sk", "t121"."hd_income_band_sk", "t121"."ib_income_band_sk", "t124"."ca_address_sk", "t124"."ca_street_number", "t124"."ca_street_name", "t124"."ca_city", "t124"."ca_zip" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_hdemo_sk", "c_current_addr_sk", "c_first_shipto_date_sk", "c_first_sales_date_sk" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_hdemo_sk", "c_current_addr_sk", "c_first_shipto_date_sk", "c_first_sales_date_sk" +FROM "customer") AS "t103" +WHERE "c_customer_sk" IS NOT NULL AND ("c_first_sales_date_sk" IS NOT NULL AND "c_first_shipto_date_sk" IS NOT NULL) AND ("c_current_cdemo_sk" IS NOT NULL AND ("c_current_hdemo_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL))) AS "t105" +INNER JOIN (SELECT "cd_demo_sk", "cd_marital_status" +FROM (SELECT "cd_demo_sk", "cd_marital_status" +FROM "customer_demographics") AS "t106" +WHERE "cd_demo_sk" IS NOT NULL) AS "t108" ON "t105"."c_current_cdemo_sk" = "t108"."cd_demo_sk" +INNER JOIN (SELECT "d_date_sk", "d_year" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t109" +WHERE "d_date_sk" IS NOT NULL) AS "t111" ON "t105"."c_first_sales_date_sk" = "t111"."d_date_sk" +INNER JOIN (SELECT "d_date_sk", "d_year" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t112" +WHERE "d_date_sk" IS NOT NULL) AS "t114" ON "t105"."c_first_shipto_date_sk" = "t114"."d_date_sk" +INNER JOIN (SELECT "t117"."hd_demo_sk", "t117"."hd_income_band_sk", "t120"."ib_income_band_sk" +FROM (SELECT "hd_demo_sk", "hd_income_band_sk" +FROM (SELECT "hd_demo_sk", "hd_income_band_sk" +FROM "household_demographics") AS "t115" +WHERE "hd_demo_sk" IS NOT NULL AND "hd_income_band_sk" IS NOT NULL) AS "t117" +INNER JOIN (SELECT "ib_income_band_sk" +FROM (SELECT "ib_income_band_sk" +FROM "income_band") AS "t118" +WHERE "ib_income_band_sk" IS NOT NULL) AS "t120" ON "t117"."hd_income_band_sk" = "t120"."ib_income_band_sk") AS "t121" ON "t105"."c_current_hdemo_sk" = "t121"."hd_demo_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_street_number", "ca_street_name", "ca_city", "ca_zip" +FROM (SELECT "ca_address_sk", "ca_street_number", "ca_street_name", "ca_city", "ca_zip" +FROM "customer_address") AS "t122" +WHERE "ca_address_sk" IS NOT NULL) AS "t124" ON "t105"."c_current_addr_sk" = "t124"."ca_address_sk") AS "t125" ON "t68"."ss_customer_sk" = "t125"."c_customer_sk" +INNER JOIN (SELECT "cd_demo_sk", "cd_marital_status" +FROM (SELECT "cd_demo_sk", "cd_marital_status" +FROM "customer_demographics") AS "t126" +WHERE "cd_demo_sk" IS NOT NULL) AS "t128" ON "t125"."cd_marital_status" <> "t128"."cd_marital_status" AND "t68"."ss_cdemo_sk" = "t128"."cd_demo_sk" +GROUP BY "t89"."i_item_sk", "t89"."i_product_name", "t99"."s_store_name", "t99"."s_zip", "t102"."ca_street_number", "t102"."ca_street_name", "t102"."ca_city", "t102"."ca_zip", "t125"."d_year", "t125"."d_year0", "t125"."ca_street_number", "t125"."ca_street_name", "t125"."ca_city", "t125"."ca_zip") AS "t130" +WHERE "t130"."$f14" IS NOT NULL) AS "t132" ON "t65"."$f1" = "t132"."$f1" AND "t65"."$f15" >= "t132"."$f15" AND "t65"."$f2" = "t132"."$f2" AND "t65"."$f3" = "t132"."$f3" +ORDER BY "t65"."$f0", "t65"."$f2", "t132"."$f15") AS "t134" + hive.sql.query.fieldNames product_name,store_name,store_zip,b_street_number,b_streen_name,b_city,b_zip,c_street_number,c_street_name,c_city,c_zip,syear,cnt,s1,s2,s3,s11,s21,s31,syear1,cnt1 + hive.sql.query.fieldTypes string,string,string,string,string,string,string,string,string,string,string,int,bigint,decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),decimal(17,2),int,bigint + hive.sql.query.split false + Select Operator + expressions: product_name (type: string), store_name (type: string), store_zip (type: string), b_street_number (type: string), b_streen_name (type: string), b_city (type: string), b_zip (type: string), c_street_number (type: string), c_street_name (type: string), c_city (type: string), c_zip (type: string), syear (type: int), cnt (type: bigint), s1 (type: decimal(17,2)), s2 (type: decimal(17,2)), s3 (type: decimal(17,2)), s11 (type: decimal(17,2)), s21 (type: decimal(17,2)), s31 (type: decimal(17,2)), syear1 (type: int), cnt1 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col20 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query65.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query65.q.out new file mode 100644 index 000000000000..d89ef5db9e5c --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query65.q.out @@ -0,0 +1,56 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t26"."s_store_name", "t26"."i_item_desc", "t26"."revenue", "t26"."i_current_price", "t26"."i_wholesale_cost", "t26"."i_brand" +FROM (SELECT "t11"."s_store_name", "t24"."i_item_desc", "t8"."$f2" AS "revenue", "t24"."i_current_price", "t24"."i_wholesale_cost", "t24"."i_brand" +FROM (SELECT "ss_store_sk", "ss_item_sk", "$f2" +FROM (SELECT "t1"."ss_store_sk", "t1"."ss_item_sk", SUM("t1"."ss_sales_price") AS "$f2" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM "date_dim") AS "t2" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +GROUP BY "t1"."ss_item_sk", "t1"."ss_store_sk") AS "t6" +WHERE "t6"."$f2" IS NOT NULL) AS "t8" +INNER JOIN (SELECT "s_store_sk", "s_store_name" +FROM (SELECT "s_store_sk", "s_store_name" +FROM "store") AS "t9" +WHERE "s_store_sk" IS NOT NULL) AS "t11" ON "t8"."ss_store_sk" = "t11"."s_store_sk" +INNER JOIN (SELECT "t18"."ss_store_sk" AS "$f0", 0.1 * CAST(SUM("t18"."$f2") / COUNT("t18"."$f2") AS DECIMAL(19, 6)) AS "EXPR$0" +FROM (SELECT "t14"."ss_item_sk", "t14"."ss_store_sk", SUM("t14"."ss_sales_price") AS "$f2" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_sales_price" +FROM "store_sales") AS "t12" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t14" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM "date_dim") AS "t15" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t17" ON "t14"."ss_sold_date_sk" = "t17"."d_date_sk" +GROUP BY "t14"."ss_item_sk", "t14"."ss_store_sk") AS "t18" +GROUP BY "t18"."ss_store_sk" +HAVING CAST(SUM("t18"."$f2") / COUNT("t18"."$f2") AS DECIMAL(19, 6)) IS NOT NULL) AS "t21" ON "t8"."ss_store_sk" = "t21"."$f0" AND "t8"."$f2" <= "t21"."EXPR$0" +INNER JOIN (SELECT "i_item_sk", "i_item_desc", "i_current_price", "i_wholesale_cost", "i_brand" +FROM (SELECT "i_item_sk", "i_item_desc", "i_current_price", "i_wholesale_cost", "i_brand" +FROM "item") AS "t22" +WHERE "i_item_sk" IS NOT NULL) AS "t24" ON "t8"."ss_item_sk" = "t24"."i_item_sk" +ORDER BY "t11"."s_store_name", "t24"."i_item_desc" +FETCH NEXT 100 ROWS ONLY) AS "t26" + hive.sql.query.fieldNames s_store_name,i_item_desc,revenue,i_current_price,i_wholesale_cost,i_brand + hive.sql.query.fieldTypes string,string,decimal(17,2),decimal(7,2),decimal(7,2),string + hive.sql.query.split false + Select Operator + expressions: s_store_name (type: string), i_item_desc (type: string), revenue (type: decimal(17,2)), i_current_price (type: decimal(7,2)), i_wholesale_cost (type: decimal(7,2)), i_brand (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query66.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query66.q.out new file mode 100644 index 000000000000..9591417d3461 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query66.q.out @@ -0,0 +1,69 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "$f0" AS "w_warehouse_name", "$f1" AS "w_warehouse_sq_ft", "$f2" AS "w_city", "$f3" AS "w_county", "$f4" AS "w_state", "$f5" AS "w_country", CAST('DIAMOND,AIRBORNE' AS VARCHAR(10485760)) AS "ship_carriers", CAST(2002 AS INTEGER) AS "year", "$f6" AS "jan_sales", "$f7" AS "feb_sales", "$f8" AS "mar_sales", "$f9" AS "apr_sales", "$f10" AS "may_sales", "$f11" AS "jun_sales", "$f12" AS "jul_sales", "$f13" AS "aug_sales", "$f14" AS "sep_sales", "$f15" AS "oct_sales", "$f16" AS "nov_sales", "$f17" AS "dec_sales", "$f18" AS "jan_sales_per_sq_foot", "$f19" AS "feb_sales_per_sq_foot", "$f20" AS "mar_sales_per_sq_foot", "$f21" AS "apr_sales_per_sq_foot", "$f22" AS "may_sales_per_sq_foot", "$f23" AS "jun_sales_per_sq_foot", "$f24" AS "jul_sales_per_sq_foot", "$f25" AS "aug_sales_per_sq_foot", "$f26" AS "sep_sales_per_sq_foot", "$f27" AS "oct_sales_per_sq_foot", "$f28" AS "nov_sales_per_sq_foot", "$f29" AS "dec_sales_per_sq_foot", "$f30" AS "jan_net", "$f31" AS "feb_net", "$f32" AS "mar_net", "$f33" AS "apr_net", "$f34" AS "may_net", "$f35" AS "jun_net", "$f36" AS "jul_net", "$f37" AS "aug_net", "$f38" AS "sep_net", "$f39" AS "oct_net", "$f40" AS "nov_net", "$f41" AS "dec_net" +FROM (SELECT "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", SUM("$f6") AS "$f6", SUM("$f7") AS "$f7", SUM("$f8") AS "$f8", SUM("$f9") AS "$f9", SUM("$f10") AS "$f10", SUM("$f11") AS "$f11", SUM("$f12") AS "$f12", SUM("$f13") AS "$f13", SUM("$f14") AS "$f14", SUM("$f15") AS "$f15", SUM("$f16") AS "$f16", SUM("$f17") AS "$f17", SUM("$f6" / CAST("$f1" AS DECIMAL(10, 0))) AS "$f18", SUM("$f7" / CAST("$f1" AS DECIMAL(10, 0))) AS "$f19", SUM("$f8" / CAST("$f1" AS DECIMAL(10, 0))) AS "$f20", SUM("$f9" / CAST("$f1" AS DECIMAL(10, 0))) AS "$f21", SUM("$f10" / CAST("$f1" AS DECIMAL(10, 0))) AS "$f22", SUM("$f11" / CAST("$f1" AS DECIMAL(10, 0))) AS "$f23", SUM("$f12" / CAST("$f1" AS DECIMAL(10, 0))) AS "$f24", SUM("$f13" / CAST("$f1" AS DECIMAL(10, 0))) AS "$f25", SUM("$f14" / CAST("$f1" AS DECIMAL(10, 0))) AS "$f26", SUM("$f15" / CAST("$f1" AS DECIMAL(10, 0))) AS "$f27", SUM("$f16" / CAST("$f1" AS DECIMAL(10, 0))) AS "$f28", SUM("$f17" / CAST("$f1" AS DECIMAL(10, 0))) AS "$f29", SUM("$f18") AS "$f30", SUM("$f19") AS "$f31", SUM("$f20") AS "$f32", SUM("$f21") AS "$f33", SUM("$f22") AS "$f34", SUM("$f23") AS "$f35", SUM("$f24") AS "$f36", SUM("$f25") AS "$f37", SUM("$f26") AS "$f38", SUM("$f27") AS "$f39", SUM("$f28") AS "$f40", SUM("$f29") AS "$f41" +FROM (SELECT "t10"."w_warehouse_name" AS "$f0", "t10"."w_warehouse_sq_ft" AS "$f1", "t10"."w_city" AS "$f2", "t10"."w_county" AS "$f3", "t10"."w_state" AS "$f4", "t10"."w_country" AS "$f5", SUM(CASE WHEN "t13"."EXPR$0" THEN "t1"."EXPR$0" ELSE 0 END) AS "$f6", SUM(CASE WHEN "t13"."EXPR$1" THEN "t1"."EXPR$0" ELSE 0 END) AS "$f7", SUM(CASE WHEN "t13"."EXPR$2" THEN "t1"."EXPR$0" ELSE 0 END) AS "$f8", SUM(CASE WHEN "t13"."EXPR$3" THEN "t1"."EXPR$0" ELSE 0 END) AS "$f9", SUM(CASE WHEN "t13"."EXPR$4" THEN "t1"."EXPR$0" ELSE 0 END) AS "$f10", SUM(CASE WHEN "t13"."EXPR$5" THEN "t1"."EXPR$0" ELSE 0 END) AS "$f11", SUM(CASE WHEN "t13"."EXPR$6" THEN "t1"."EXPR$0" ELSE 0 END) AS "$f12", SUM(CASE WHEN "t13"."EXPR$7" THEN "t1"."EXPR$0" ELSE 0 END) AS "$f13", SUM(CASE WHEN "t13"."EXPR$8" THEN "t1"."EXPR$0" ELSE 0 END) AS "$f14", SUM(CASE WHEN "t13"."EXPR$9" THEN "t1"."EXPR$0" ELSE 0 END) AS "$f15", SUM(CASE WHEN "t13"."EXPR$10" THEN "t1"."EXPR$0" ELSE 0 END) AS "$f16", SUM(CASE WHEN "t13"."EXPR$11" THEN "t1"."EXPR$0" ELSE 0 END) AS "$f17", SUM(CASE WHEN "t13"."EXPR$0" THEN "t1"."EXPR$1" ELSE 0 END) AS "$f18", SUM(CASE WHEN "t13"."EXPR$1" THEN "t1"."EXPR$1" ELSE 0 END) AS "$f19", SUM(CASE WHEN "t13"."EXPR$2" THEN "t1"."EXPR$1" ELSE 0 END) AS "$f20", SUM(CASE WHEN "t13"."EXPR$3" THEN "t1"."EXPR$1" ELSE 0 END) AS "$f21", SUM(CASE WHEN "t13"."EXPR$4" THEN "t1"."EXPR$1" ELSE 0 END) AS "$f22", SUM(CASE WHEN "t13"."EXPR$5" THEN "t1"."EXPR$1" ELSE 0 END) AS "$f23", SUM(CASE WHEN "t13"."EXPR$6" THEN "t1"."EXPR$1" ELSE 0 END) AS "$f24", SUM(CASE WHEN "t13"."EXPR$7" THEN "t1"."EXPR$1" ELSE 0 END) AS "$f25", SUM(CASE WHEN "t13"."EXPR$8" THEN "t1"."EXPR$1" ELSE 0 END) AS "$f26", SUM(CASE WHEN "t13"."EXPR$9" THEN "t1"."EXPR$1" ELSE 0 END) AS "$f27", SUM(CASE WHEN "t13"."EXPR$10" THEN "t1"."EXPR$1" ELSE 0 END) AS "$f28", SUM(CASE WHEN "t13"."EXPR$11" THEN "t1"."EXPR$1" ELSE 0 END) AS "$f29" +FROM (SELECT "ws_sold_date_sk", "ws_sold_time_sk", "ws_ship_mode_sk", "ws_warehouse_sk", "ws_sales_price" * CAST("ws_quantity" AS DECIMAL(10, 0)) AS "EXPR$0", "ws_net_paid_inc_tax" * CAST("ws_quantity" AS DECIMAL(10, 0)) AS "EXPR$1" +FROM (SELECT "ws_sold_date_sk", "ws_sold_time_sk", "ws_ship_mode_sk", "ws_warehouse_sk", "ws_quantity", "ws_sales_price", "ws_net_paid_inc_tax" +FROM "web_sales") AS "t" +WHERE "ws_warehouse_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL AND "ws_sold_time_sk" IS NOT NULL AND "ws_ship_mode_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_time" +FROM "time_dim") AS "t2" +WHERE "t_time" BETWEEN 49530 AND 78330 AND "t_time_sk" IS NOT NULL) AS "t4" ON "t1"."ws_sold_time_sk" = "t4"."t_time_sk" +INNER JOIN (SELECT "sm_ship_mode_sk" +FROM (SELECT "sm_ship_mode_sk", "sm_carrier" +FROM "ship_mode") AS "t5" +WHERE "sm_carrier" IN ('AIRBORNE', 'DIAMOND') AND "sm_ship_mode_sk" IS NOT NULL) AS "t7" ON "t1"."ws_ship_mode_sk" = "t7"."sm_ship_mode_sk" +INNER JOIN (SELECT "w_warehouse_sk", "w_warehouse_name", "w_warehouse_sq_ft", "w_city", "w_county", "w_state", "w_country" +FROM (SELECT "w_warehouse_sk", "w_warehouse_name", "w_warehouse_sq_ft", "w_city", "w_county", "w_state", "w_country" +FROM "warehouse") AS "t8" +WHERE "w_warehouse_sk" IS NOT NULL) AS "t10" ON "t1"."ws_warehouse_sk" = "t10"."w_warehouse_sk" +INNER JOIN (SELECT "d_date_sk", "d_moy" = 1 AS "EXPR$0", "d_moy" = 2 AS "EXPR$1", "d_moy" = 3 AS "EXPR$2", "d_moy" = 4 AS "EXPR$3", "d_moy" = 5 AS "EXPR$4", "d_moy" = 6 AS "EXPR$5", "d_moy" = 7 AS "EXPR$6", "d_moy" = 8 AS "EXPR$7", "d_moy" = 9 AS "EXPR$8", "d_moy" = 10 AS "EXPR$9", "d_moy" = 11 AS "EXPR$10", "d_moy" = 12 AS "EXPR$11" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t11" +WHERE "d_year" = 2002 AND "d_date_sk" IS NOT NULL) AS "t13" ON "t1"."ws_sold_date_sk" = "t13"."d_date_sk" +GROUP BY "t10"."w_warehouse_name", "t10"."w_warehouse_sq_ft", "t10"."w_city", "t10"."w_county", "t10"."w_state", "t10"."w_country" +UNION ALL +SELECT "t28"."w_warehouse_name" AS "$f0", "t28"."w_warehouse_sq_ft" AS "$f1", "t28"."w_city" AS "$f2", "t28"."w_county" AS "$f3", "t28"."w_state" AS "$f4", "t28"."w_country" AS "$f5", SUM(CASE WHEN "t31"."EXPR$0" THEN "t19"."EXPR$0" ELSE 0 END) AS "$f6", SUM(CASE WHEN "t31"."EXPR$1" THEN "t19"."EXPR$0" ELSE 0 END) AS "$f7", SUM(CASE WHEN "t31"."EXPR$2" THEN "t19"."EXPR$0" ELSE 0 END) AS "$f8", SUM(CASE WHEN "t31"."EXPR$3" THEN "t19"."EXPR$0" ELSE 0 END) AS "$f9", SUM(CASE WHEN "t31"."EXPR$4" THEN "t19"."EXPR$0" ELSE 0 END) AS "$f10", SUM(CASE WHEN "t31"."EXPR$5" THEN "t19"."EXPR$0" ELSE 0 END) AS "$f11", SUM(CASE WHEN "t31"."EXPR$6" THEN "t19"."EXPR$0" ELSE 0 END) AS "$f12", SUM(CASE WHEN "t31"."EXPR$7" THEN "t19"."EXPR$0" ELSE 0 END) AS "$f13", SUM(CASE WHEN "t31"."EXPR$8" THEN "t19"."EXPR$0" ELSE 0 END) AS "$f14", SUM(CASE WHEN "t31"."EXPR$9" THEN "t19"."EXPR$0" ELSE 0 END) AS "$f15", SUM(CASE WHEN "t31"."EXPR$10" THEN "t19"."EXPR$0" ELSE 0 END) AS "$f16", SUM(CASE WHEN "t31"."EXPR$11" THEN "t19"."EXPR$0" ELSE 0 END) AS "$f17", SUM(CASE WHEN "t31"."EXPR$0" THEN "t19"."EXPR$1" ELSE 0 END) AS "$f18", SUM(CASE WHEN "t31"."EXPR$1" THEN "t19"."EXPR$1" ELSE 0 END) AS "$f19", SUM(CASE WHEN "t31"."EXPR$2" THEN "t19"."EXPR$1" ELSE 0 END) AS "$f20", SUM(CASE WHEN "t31"."EXPR$3" THEN "t19"."EXPR$1" ELSE 0 END) AS "$f21", SUM(CASE WHEN "t31"."EXPR$4" THEN "t19"."EXPR$1" ELSE 0 END) AS "$f22", SUM(CASE WHEN "t31"."EXPR$5" THEN "t19"."EXPR$1" ELSE 0 END) AS "$f23", SUM(CASE WHEN "t31"."EXPR$6" THEN "t19"."EXPR$1" ELSE 0 END) AS "$f24", SUM(CASE WHEN "t31"."EXPR$7" THEN "t19"."EXPR$1" ELSE 0 END) AS "$f25", SUM(CASE WHEN "t31"."EXPR$8" THEN "t19"."EXPR$1" ELSE 0 END) AS "$f26", SUM(CASE WHEN "t31"."EXPR$9" THEN "t19"."EXPR$1" ELSE 0 END) AS "$f27", SUM(CASE WHEN "t31"."EXPR$10" THEN "t19"."EXPR$1" ELSE 0 END) AS "$f28", SUM(CASE WHEN "t31"."EXPR$11" THEN "t19"."EXPR$1" ELSE 0 END) AS "$f29" +FROM (SELECT "cs_sold_date_sk", "cs_sold_time_sk", "cs_ship_mode_sk", "cs_warehouse_sk", "cs_ext_sales_price" * CAST("cs_quantity" AS DECIMAL(10, 0)) AS "EXPR$0", "cs_net_paid_inc_ship_tax" * CAST("cs_quantity" AS DECIMAL(10, 0)) AS "EXPR$1" +FROM (SELECT "cs_sold_date_sk", "cs_sold_time_sk", "cs_ship_mode_sk", "cs_warehouse_sk", "cs_quantity", "cs_ext_sales_price", "cs_net_paid_inc_ship_tax" +FROM "catalog_sales") AS "t17" +WHERE "cs_warehouse_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL AND "cs_sold_time_sk" IS NOT NULL AND "cs_ship_mode_sk" IS NOT NULL) AS "t19" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_time" +FROM "time_dim") AS "t20" +WHERE "t_time" BETWEEN 49530 AND 78330 AND "t_time_sk" IS NOT NULL) AS "t22" ON "t19"."cs_sold_time_sk" = "t22"."t_time_sk" +INNER JOIN (SELECT "sm_ship_mode_sk" +FROM (SELECT "sm_ship_mode_sk", "sm_carrier" +FROM "ship_mode") AS "t23" +WHERE "sm_carrier" IN ('AIRBORNE', 'DIAMOND') AND "sm_ship_mode_sk" IS NOT NULL) AS "t25" ON "t19"."cs_ship_mode_sk" = "t25"."sm_ship_mode_sk" +INNER JOIN (SELECT "w_warehouse_sk", "w_warehouse_name", "w_warehouse_sq_ft", "w_city", "w_county", "w_state", "w_country" +FROM (SELECT "w_warehouse_sk", "w_warehouse_name", "w_warehouse_sq_ft", "w_city", "w_county", "w_state", "w_country" +FROM "warehouse") AS "t26" +WHERE "w_warehouse_sk" IS NOT NULL) AS "t28" ON "t19"."cs_warehouse_sk" = "t28"."w_warehouse_sk" +INNER JOIN (SELECT "d_date_sk", "d_moy" = 1 AS "EXPR$0", "d_moy" = 2 AS "EXPR$1", "d_moy" = 3 AS "EXPR$2", "d_moy" = 4 AS "EXPR$3", "d_moy" = 5 AS "EXPR$4", "d_moy" = 6 AS "EXPR$5", "d_moy" = 7 AS "EXPR$6", "d_moy" = 8 AS "EXPR$7", "d_moy" = 9 AS "EXPR$8", "d_moy" = 10 AS "EXPR$9", "d_moy" = 11 AS "EXPR$10", "d_moy" = 12 AS "EXPR$11" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t29" +WHERE "d_year" = 2002 AND "d_date_sk" IS NOT NULL) AS "t31" ON "t19"."cs_sold_date_sk" = "t31"."d_date_sk" +GROUP BY "t28"."w_warehouse_name", "t28"."w_warehouse_sq_ft", "t28"."w_city", "t28"."w_county", "t28"."w_state", "t28"."w_country") AS "t35" +GROUP BY "$f0", "$f1", "$f2", "$f3", "$f4", "$f5" +ORDER BY "$f0" +FETCH NEXT 100 ROWS ONLY) AS "t38" + hive.sql.query.fieldNames w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_sales_per_sq_foot,feb_sales_per_sq_foot,mar_sales_per_sq_foot,apr_sales_per_sq_foot,may_sales_per_sq_foot,jun_sales_per_sq_foot,jul_sales_per_sq_foot,aug_sales_per_sq_foot,sep_sales_per_sq_foot,oct_sales_per_sq_foot,nov_sales_per_sq_foot,dec_sales_per_sq_foot,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net + hive.sql.query.fieldTypes string,int,string,string,string,string,string,int,decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,12),decimal(38,12),decimal(38,12),decimal(38,12),decimal(38,12),decimal(38,12),decimal(38,12),decimal(38,12),decimal(38,12),decimal(38,12),decimal(38,12),decimal(38,12),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2),decimal(38,2) + hive.sql.query.split false + Select Operator + expressions: w_warehouse_name (type: string), w_warehouse_sq_ft (type: int), w_city (type: string), w_county (type: string), w_state (type: string), w_country (type: string), ship_carriers (type: string), year (type: int), jan_sales (type: decimal(38,2)), feb_sales (type: decimal(38,2)), mar_sales (type: decimal(38,2)), apr_sales (type: decimal(38,2)), may_sales (type: decimal(38,2)), jun_sales (type: decimal(38,2)), jul_sales (type: decimal(38,2)), aug_sales (type: decimal(38,2)), sep_sales (type: decimal(38,2)), oct_sales (type: decimal(38,2)), nov_sales (type: decimal(38,2)), dec_sales (type: decimal(38,2)), jan_sales_per_sq_foot (type: decimal(38,12)), feb_sales_per_sq_foot (type: decimal(38,12)), mar_sales_per_sq_foot (type: decimal(38,12)), apr_sales_per_sq_foot (type: decimal(38,12)), may_sales_per_sq_foot (type: decimal(38,12)), jun_sales_per_sq_foot (type: decimal(38,12)), jul_sales_per_sq_foot (type: decimal(38,12)), aug_sales_per_sq_foot (type: decimal(38,12)), sep_sales_per_sq_foot (type: decimal(38,12)), oct_sales_per_sq_foot (type: decimal(38,12)), nov_sales_per_sq_foot (type: decimal(38,12)), dec_sales_per_sq_foot (type: decimal(38,12)), jan_net (type: decimal(38,2)), feb_net (type: decimal(38,2)), mar_net (type: decimal(38,2)), apr_net (type: decimal(38,2)), may_net (type: decimal(38,2)), jun_net (type: decimal(38,2)), jul_net (type: decimal(38,2)), aug_net (type: decimal(38,2)), sep_net (type: decimal(38,2)), oct_net (type: decimal(38,2)), nov_net (type: decimal(38,2)), dec_net (type: decimal(38,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15, _col16, _col17, _col18, _col19, _col20, _col21, _col22, _col23, _col24, _col25, _col26, _col27, _col28, _col29, _col30, _col31, _col32, _col33, _col34, _col35, _col36, _col37, _col38, _col39, _col40, _col41, _col42, _col43 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query67.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query67.q.out new file mode 100644 index 000000000000..ee74a3efbce0 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query67.q.out @@ -0,0 +1,159 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_sold_date_sk", "t1"."ss_item_sk", "t1"."ss_store_sk", "t1"."$f8", "t4"."s_store_sk", "t4"."s_store_id", "t7"."d_date_sk", "t7"."d_year", "t7"."d_moy", "t7"."d_qoy", "t10"."i_item_sk", "t10"."i_brand", "t10"."i_class", "t10"."i_category", "t10"."i_product_name" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", CASE WHEN "ss_sales_price" IS NOT NULL AND CAST("ss_quantity" AS DECIMAL(10, 0)) IS NOT NULL THEN "ss_sales_price" * CAST("ss_quantity" AS DECIMAL(10, 0)) ELSE 0 END AS "$f8" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_quantity", "ss_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "s_store_sk", "s_store_id" +FROM (SELECT "s_store_sk", "s_store_id" +FROM "store") AS "t2" +WHERE "s_store_sk" IS NOT NULL) AS "t4" ON "t1"."ss_store_sk" = "t4"."s_store_sk" +INNER JOIN (SELECT "d_date_sk", "d_year", "d_moy", "d_qoy" +FROM (SELECT "d_date_sk", "d_month_seq", "d_year", "d_moy", "d_qoy" +FROM "date_dim") AS "t5" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_date_sk" = "t7"."d_date_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand", "i_class", "i_category", "i_product_name" +FROM (SELECT "i_item_sk", "i_brand", "i_class", "i_category", "i_product_name" +FROM "item") AS "t8" +WHERE "i_item_sk" IS NOT NULL) AS "t10" ON "t1"."ss_item_sk" = "t10"."i_item_sk" + hive.sql.query.fieldNames ss_sold_date_sk,ss_item_sk,ss_store_sk,$f8,s_store_sk,s_store_id,d_date_sk,d_year,d_moy,d_qoy,i_item_sk,i_brand,i_class,i_category,i_product_name + hive.sql.query.fieldTypes int,bigint,int,decimal(18,2),int,string,int,int,int,int,bigint,string,string,string,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 1044 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f8 (type: decimal(18,2)), s_store_id (type: string), d_year (type: int), d_moy (type: int), d_qoy (type: int), i_brand (type: string), i_class (type: string), i_category (type: string), i_product_name (type: string) + outputColumnNames: _col3, _col5, _col7, _col8, _col9, _col11, _col12, _col13, _col14 + Statistics: Num rows: 1 Data size: 1044 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3) + keys: _col5 (type: string), _col7 (type: int), _col8 (type: int), _col9 (type: int), _col11 (type: string), _col12 (type: string), _col13 (type: string), _col14 (type: string), 0L (type: bigint) + grouping sets: 0, 128, 160, 176, 240, 241, 249, 253, 255 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + Statistics: Num rows: 9 Data size: 9396 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string), _col8 (type: bigint) + null sort order: zzzzzzzzz + sort order: +++++++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string), _col8 (type: bigint) + Statistics: Num rows: 9 Data size: 9396 Basic stats: COMPLETE Column stats: NONE + value expressions: _col9 (type: decimal(28,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string), KEY._col1 (type: int), KEY._col2 (type: int), KEY._col3 (type: int), KEY._col4 (type: string), KEY._col5 (type: string), KEY._col6 (type: string), KEY._col7 (type: string), KEY._col8 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col9 + Statistics: Num rows: 4 Data size: 4176 Basic stats: COMPLETE Column stats: NONE + pruneGroupingSetId: true + Top N Key Operator + sort order: +- + keys: _col6 (type: string), _col9 (type: decimal(28,2)) + null sort order: aa + Map-reduce partition columns: _col6 (type: string) + Statistics: Num rows: 4 Data size: 4176 Basic stats: COMPLETE Column stats: NONE + top n: 101 + Select Operator + expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string), _col9 (type: decimal(28,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 4 Data size: 4176 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col6 (type: string), _col8 (type: decimal(28,2)) + null sort order: aa + sort order: +- + Map-reduce partition columns: _col6 (type: string) + Statistics: Num rows: 4 Data size: 4176 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col3 (type: int), _col4 (type: string), _col5 (type: string), _col7 (type: string) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: string), VALUE._col1 (type: int), VALUE._col2 (type: int), VALUE._col3 (type: int), VALUE._col4 (type: string), VALUE._col5 (type: string), KEY.reducesinkkey0 (type: string), VALUE._col6 (type: string), KEY.reducesinkkey1 (type: decimal(28,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 4 Data size: 4176 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: int, _col2: int, _col3: int, _col4: string, _col5: string, _col6: string, _col7: string, _col8: decimal(28,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col8 DESC NULLS FIRST + partition by: _col6 + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: _col8 + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 4 Data size: 4176 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (rank_window_0 <= 100) (type: boolean) + Statistics: Num rows: 1 Data size: 1044 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++++++++++ + keys: _col6 (type: string), _col5 (type: string), _col4 (type: string), _col7 (type: string), _col1 (type: int), _col3 (type: int), _col2 (type: int), _col0 (type: string), _col8 (type: decimal(28,2)), rank_window_0 (type: int) + null sort order: zzzzzzzzzz + Statistics: Num rows: 1 Data size: 1044 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col6 (type: string), _col5 (type: string), _col4 (type: string), _col7 (type: string), _col1 (type: int), _col3 (type: int), _col2 (type: int), _col0 (type: string), _col8 (type: decimal(28,2)), rank_window_0 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + Statistics: Num rows: 1 Data size: 1044 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: int), _col5 (type: int), _col6 (type: int), _col7 (type: string), _col8 (type: decimal(28,2)), _col9 (type: int) + null sort order: zzzzzzzzzz + sort order: ++++++++++ + Statistics: Num rows: 1 Data size: 1044 Basic stats: COMPLETE Column stats: NONE + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), KEY.reducesinkkey3 (type: string), KEY.reducesinkkey4 (type: int), KEY.reducesinkkey5 (type: int), KEY.reducesinkkey6 (type: int), KEY.reducesinkkey7 (type: string), KEY.reducesinkkey8 (type: decimal(28,2)), KEY.reducesinkkey9 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + Statistics: Num rows: 1 Data size: 1044 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 1044 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 1044 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query68.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query68.q.out new file mode 100644 index 000000000000..c3b1f7eee08a --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query68.q.out @@ -0,0 +1,53 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "t23"."c_last_name", "t23"."c_first_name", "t23"."ca_city", "t23"."bought_city", "t23"."ss_ticket_number", "t23"."extended_price", "t23"."extended_tax", "t23"."list_price" +FROM (SELECT "t1"."c_last_name", "t1"."c_first_name", "t4"."ca_city", "t21"."bought_city", "t21"."ss_ticket_number", "t21"."extended_price", "t21"."extended_tax", "t21"."list_price" +FROM (SELECT "c_customer_sk", "c_current_addr_sk", "c_first_name", "c_last_name" +FROM (SELECT "c_customer_sk", "c_current_addr_sk", "c_first_name", "c_last_name" +FROM "customer") AS "t" +WHERE "c_customer_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_city" +FROM (SELECT "ca_address_sk", "ca_city" +FROM "customer_address") AS "t2" +WHERE "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."c_current_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "t7"."ss_ticket_number", "t7"."ss_customer_sk", "t19"."ca_city" AS "bought_city", SUM("t7"."ss_ext_sales_price") AS "extended_price", SUM("t7"."ss_ext_list_price") AS "list_price", SUM("t7"."ss_ext_tax") AS "extended_tax" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_hdemo_sk", "ss_addr_sk", "ss_store_sk", "ss_ticket_number", "ss_ext_sales_price", "ss_ext_list_price", "ss_ext_tax" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_hdemo_sk", "ss_addr_sk", "ss_store_sk", "ss_ticket_number", "ss_ext_sales_price", "ss_ext_list_price", "ss_ext_tax" +FROM "store_sales") AS "t5" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL AND "ss_hdemo_sk" IS NOT NULL AND "ss_addr_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL) AS "t7" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_dom" +FROM "date_dim") AS "t8" +WHERE "d_year" IN (1998, 1999, 2000) AND "d_dom" BETWEEN 1 AND 2 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t7"."ss_sold_date_sk" = "t10"."d_date_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_city" +FROM "store") AS "t11" +WHERE "s_city" IN ('Cedar Grove', 'Wildwood') AND "s_store_sk" IS NOT NULL) AS "t13" ON "t7"."ss_store_sk" = "t13"."s_store_sk" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t14" +WHERE ("hd_dep_count" = 2 OR "hd_vehicle_count" = 1) AND "hd_demo_sk" IS NOT NULL) AS "t16" ON "t7"."ss_hdemo_sk" = "t16"."hd_demo_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_city" +FROM (SELECT "ca_address_sk", "ca_city" +FROM "customer_address") AS "t17" +WHERE "ca_address_sk" IS NOT NULL) AS "t19" ON "t7"."ss_addr_sk" = "t19"."ca_address_sk" +GROUP BY "t7"."ss_customer_sk", "t7"."ss_addr_sk", "t7"."ss_ticket_number", "t19"."ca_city") AS "t21" ON "t4"."ca_city" <> "t21"."bought_city" AND "t1"."c_customer_sk" = "t21"."ss_customer_sk" +ORDER BY "t1"."c_last_name", "t21"."ss_ticket_number" +FETCH NEXT 100 ROWS ONLY) AS "t23" + hive.sql.query.fieldNames c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,extended_price,extended_tax,list_price + hive.sql.query.fieldTypes string,string,string,string,bigint,decimal(17,2),decimal(17,2),decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: c_last_name (type: string), c_first_name (type: string), ca_city (type: string), bought_city (type: string), ss_ticket_number (type: bigint), extended_price (type: decimal(17,2)), extended_tax (type: decimal(17,2)), list_price (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query69.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query69.q.out new file mode 100644 index 000000000000..39842e4f7b3a --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query69.q.out @@ -0,0 +1,271 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Map 9 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: c + properties: + hive.sql.query SELECT "t1"."c_customer_sk", "t1"."c_current_cdemo_sk", "t1"."c_current_addr_sk", "t4"."ca_address_sk", "t4"."ca_state", "t7"."cd_demo_sk", "t7"."cd_gender", "t7"."cd_marital_status", "t7"."cd_education_status", "t7"."cd_purchase_estimate", "t7"."cd_credit_rating" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_addr_sk" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_addr_sk" +FROM "customer") AS "t" +WHERE "c_current_addr_sk" IS NOT NULL AND "c_current_cdemo_sk" IS NOT NULL AND "c_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk", "ca_state" +FROM (SELECT "ca_address_sk", "ca_state" +FROM "customer_address") AS "t2" +WHERE "ca_state" IN ('CO', 'IL', 'MN') AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."c_current_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "cd_demo_sk", "cd_gender", "cd_marital_status", "cd_education_status", "cd_purchase_estimate", "cd_credit_rating" +FROM (SELECT "cd_demo_sk", "cd_gender", "cd_marital_status", "cd_education_status", "cd_purchase_estimate", "cd_credit_rating" +FROM "customer_demographics") AS "t5" +WHERE "cd_demo_sk" IS NOT NULL) AS "t7" ON "t1"."c_current_cdemo_sk" = "t7"."cd_demo_sk" + hive.sql.query.fieldNames c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,ca_address_sk,ca_state,cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating + hive.sql.query.fieldTypes int,int,int,int,string,int,string,string,string,int,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 744 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_customer_sk (type: int), cd_gender (type: string), cd_marital_status (type: string), cd_education_status (type: string), cd_purchase_estimate (type: int), cd_credit_rating (type: string) + outputColumnNames: _col0, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 1 Data size: 744 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 744 Basic stats: COMPLETE Column stats: NONE + value expressions: _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: int), _col10 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_customer_sk" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk" +FROM "store_sales") AS "t" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 1999 AND "d_moy" BETWEEN 1 AND 3 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames ss_customer_sk + hive.sql.query.fieldTypes int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_customer_sk (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 8 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT TRUE AS "literalTrue", "t1"."ws_bill_customer_sk" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk" +FROM "web_sales") AS "t" +WHERE "ws_bill_customer_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 1999 AND "d_moy" BETWEEN 1 AND 3 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_sold_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames literalTrue,ws_bill_customer_sk + hive.sql.query.fieldTypes boolean,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: literaltrue (type: boolean), ws_bill_customer_sk (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT TRUE AS "literalTrue", "t1"."cs_ship_customer_sk" +FROM (SELECT "cs_sold_date_sk", "cs_ship_customer_sk" +FROM (SELECT "cs_sold_date_sk", "cs_ship_customer_sk" +FROM "catalog_sales") AS "t" +WHERE "cs_ship_customer_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 1999 AND "d_moy" BETWEEN 1 AND 3 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_sold_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames literalTrue,cs_ship_customer_sk + hive.sql.query.fieldTypes boolean,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_ship_customer_sk (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col0, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 1 Data size: 818 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 818 Basic stats: COMPLETE Column stats: NONE + value expressions: _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: int), _col10 (type: string) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col1 (type: int) + outputColumnNames: _col0, _col6, _col7, _col8, _col9, _col10, _col11 + Statistics: Num rows: 1 Data size: 899 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: _col11 is null (type: boolean) + Statistics: Num rows: 1 Data size: 899 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: int), _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: int), _col10 (type: string) + outputColumnNames: _col0, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 1 Data size: 899 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 899 Basic stats: COMPLETE Column stats: NONE + value expressions: _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: int), _col10 (type: string) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Anti Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 1 Data size: 988 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +++++ + keys: _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: int), _col10 (type: string) + null sort order: zzzzz + Statistics: Num rows: 1 Data size: 988 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: count() + keys: _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: int), _col10 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 988 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: int), _col4 (type: string) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: int), _col4 (type: string) + Statistics: Num rows: 1 Data size: 988 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: bigint) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string), KEY._col3 (type: int), KEY._col4 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 988 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col5 (type: bigint), _col3 (type: int), _col4 (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col6 + Statistics: Num rows: 1 Data size: 988 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col4 (type: int), _col6 (type: string) + null sort order: zzzzz + sort order: +++++ + Statistics: Num rows: 1 Data size: 988 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), VALUE._col0 (type: bigint), KEY.reducesinkkey3 (type: int), VALUE._col0 (type: bigint), KEY.reducesinkkey4 (type: string), VALUE._col0 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 988 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 988 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 988 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query7.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query7.q.out new file mode 100644 index 000000000000..aa62b6f33421 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query7.q.out @@ -0,0 +1,44 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t16"."i_item_id", "t16"."agg1", "t16"."agg2", "t16"."agg3", "t16"."agg4" +FROM (SELECT "t13"."i_item_id", CAST(SUM("t1"."ss_quantity") AS DOUBLE PRECISION) / COUNT("t1"."ss_quantity") AS "agg1", CAST(SUM("t1"."ss_list_price") / COUNT("t1"."ss_list_price") AS DECIMAL(11, 6)) AS "agg2", CAST(SUM("t1"."ss_coupon_amt") / COUNT("t1"."ss_coupon_amt") AS DECIMAL(11, 6)) AS "agg3", CAST(SUM("t1"."ss_sales_price") / COUNT("t1"."ss_sales_price") AS DECIMAL(11, 6)) AS "agg4" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_cdemo_sk", "ss_promo_sk", "ss_quantity", "ss_list_price", "ss_sales_price", "ss_coupon_amt" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_cdemo_sk", "ss_promo_sk", "ss_quantity", "ss_list_price", "ss_sales_price", "ss_coupon_amt" +FROM "store_sales") AS "t" +WHERE "ss_cdemo_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL AND "ss_promo_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "cd_demo_sk" +FROM (SELECT "cd_demo_sk", "cd_gender", "cd_marital_status", "cd_education_status" +FROM "customer_demographics") AS "t2" +WHERE "cd_gender" = 'F' AND "cd_marital_status" = 'W' AND "cd_education_status" = 'Primary' AND "cd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ss_cdemo_sk" = "t4"."cd_demo_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t5" +WHERE "d_year" = 1998 AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_date_sk" = "t7"."d_date_sk" +INNER JOIN (SELECT "p_promo_sk" +FROM (SELECT "p_promo_sk", "p_channel_email", "p_channel_event" +FROM "promotion") AS "t8" +WHERE ("p_channel_email" = 'N' OR "p_channel_event" = 'N') AND "p_promo_sk" IS NOT NULL) AS "t10" ON "t1"."ss_promo_sk" = "t10"."p_promo_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t11" +WHERE "i_item_sk" IS NOT NULL) AS "t13" ON "t1"."ss_item_sk" = "t13"."i_item_sk" +GROUP BY "t13"."i_item_id" +ORDER BY "t13"."i_item_id" +FETCH NEXT 100 ROWS ONLY) AS "t16" + hive.sql.query.fieldNames i_item_id,agg1,agg2,agg3,agg4 + hive.sql.query.fieldTypes string,double,decimal(11,6),decimal(11,6),decimal(11,6) + hive.sql.query.split false + Select Operator + expressions: i_item_id (type: string), agg1 (type: double), agg2 (type: decimal(11,6)), agg3 (type: decimal(11,6)), agg4 (type: decimal(11,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query70.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query70.q.out new file mode 100644 index 000000000000..decb697a0b49 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query70.q.out @@ -0,0 +1,258 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE) + Reducer 7 <- Map 6 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_sold_date_sk", "t1"."ss_store_sk", "t1"."ss_net_profit", "t4"."d_date_sk", "t4"."d_month_seq", "t7"."s_store_sk", "t7"."s_county", "t7"."s_state" +FROM (SELECT "ss_sold_date_sk", "ss_store_sk", "ss_net_profit" +FROM (SELECT "ss_sold_date_sk", "ss_store_sk", "ss_net_profit" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_month_seq" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM "date_dim") AS "t2" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "s_store_sk", "s_county", "s_state" +FROM (SELECT "s_store_sk", "s_county", "s_state" +FROM "store") AS "t5" +WHERE "s_state" IS NOT NULL AND "s_store_sk" IS NOT NULL) AS "t7" ON "t1"."ss_store_sk" = "t7"."s_store_sk" + hive.sql.query.fieldNames ss_sold_date_sk,ss_store_sk,ss_net_profit,d_date_sk,d_month_seq,s_store_sk,s_county,s_state + hive.sql.query.fieldTypes int,int,decimal(7,2),int,int,int,string,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_net_profit (type: decimal(7,2)), s_county (type: string), s_state (type: string) + outputColumnNames: _col2, _col6, _col7 + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col7 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col7 (type: string) + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(7,2)), _col6 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t7"."s_state", SUM("t1"."ss_net_profit") AS "$f1" +FROM (SELECT "ss_sold_date_sk", "ss_store_sk", "ss_net_profit" +FROM (SELECT "ss_sold_date_sk", "ss_store_sk", "ss_net_profit" +FROM "store_sales") AS "t" +WHERE "ss_store_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM "date_dim") AS "t2" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "s_store_sk", "s_state" +FROM (SELECT "s_store_sk", "s_state" +FROM "store") AS "t5" +WHERE "s_store_sk" IS NOT NULL AND "s_state" IS NOT NULL) AS "t7" ON "t1"."ss_store_sk" = "t7"."s_store_sk" +GROUP BY "t7"."s_state" + hive.sql.query.fieldNames s_state,$f1 + hive.sql.query.fieldTypes string,decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +- + keys: s_state (type: string), $f1 (type: decimal(17,2)) + null sort order: aa + Map-reduce partition columns: s_state (type: string) + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + top n: 6 + Select Operator + expressions: s_state (type: string), $f1 (type: decimal(17,2)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: decimal(17,2)) + null sort order: aa + sort order: +- + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col7 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col2, _col6, _col7 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col7 (type: string), _col6 (type: string), _col2 (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col2) + keys: _col0 (type: string), _col1 (type: string), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 3 Data size: 1584 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + Statistics: Num rows: 3 Data size: 1584 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(17,2)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: string), _col3 (type: decimal(17,2)), _col2 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: (grouping(_col3, 1L) + grouping(_col3, 0L)) (type: bigint), CASE WHEN ((grouping(_col3, 0L) = UDFToLong(0))) THEN (_col0) ELSE (CAST( null AS STRING)) END (type: string), _col2 (type: decimal(17,2)) + null sort order: aaa + sort order: ++- + Map-reduce partition columns: (grouping(_col3, 1L) + grouping(_col3, 0L)) (type: bigint), CASE WHEN ((grouping(_col3, 0L) = UDFToLong(0))) THEN (_col0) ELSE (CAST( null AS STRING)) END (type: string) + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col1 (type: string), _col3 (type: bigint) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: string), VALUE._col1 (type: string), KEY.reducesinkkey2 (type: decimal(17,2)), VALUE._col2 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: string, _col2: decimal(17,2), _col3: bigint + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col2 DESC NULLS FIRST + partition by: (grouping(_col3, 1L) + grouping(_col3, 0L)), CASE WHEN ((grouping(_col3, 0L) = UDFToLong(0))) THEN (_col0) ELSE (CAST( null AS STRING)) END + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: _col2 + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: -++ + keys: (grouping(_col3, 1L) + grouping(_col3, 0L)) (type: bigint), if(((grouping(_col3, 1L) + grouping(_col3, 0L)) = 0L), _col0, null) (type: string), rank_window_0 (type: int) + null sort order: azz + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col2 (type: decimal(17,2)), _col0 (type: string), _col1 (type: string), (grouping(_col3, 1L) + grouping(_col3, 0L)) (type: bigint), rank_window_0 (type: int), if(((grouping(_col3, 1L) + grouping(_col3, 0L)) = 0L), _col0, null) (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: bigint), _col5 (type: string), _col4 (type: int) + null sort order: azz + sort order: -++ + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(17,2)), _col1 (type: string), _col2 (type: string) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: decimal(17,2)), VALUE._col1 (type: string), VALUE._col2 (type: string), KEY.reducesinkkey0 (type: bigint), KEY.reducesinkkey2 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 528 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 7 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: decimal(17,2)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col1 DESC NULLS FIRST + partition by: _col0 + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: _col1 + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (rank_window_0 <= 5) (type: boolean) + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 296 Basic stats: COMPLETE Column stats: NONE + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query71.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query71.q.out new file mode 100644 index 000000000000..06391f15a8fa --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query71.q.out @@ -0,0 +1,209 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Map 1 <- Union 2 (CONTAINS) + Map 7 <- Union 2 (CONTAINS) + Map 8 <- Union 2 (CONTAINS) + Reducer 3 <- Map 9 (SIMPLE_EDGE), Union 2 (SIMPLE_EDGE) + Reducer 4 <- Map 10 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: web_sales + Statistics: Num rows: 1 Data size: 124 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ext_price (type: decimal(7,2)), sold_item_sk (type: bigint), time_sk (type: int) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 124 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: bigint) + Statistics: Num rows: 3 Data size: 372 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(7,2)), _col2 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 10 + Map Operator Tree: + TableScan + alias: time_dim + properties: + hive.sql.query SELECT "t_time_sk", "t_hour", "t_minute" +FROM (SELECT "t_time_sk", "t_hour", "t_minute", "t_meal_time" +FROM "time_dim") AS "t" +WHERE "t_meal_time" IN ('breakfast', 'dinner') AND "t_time_sk" IS NOT NULL + hive.sql.query.fieldNames t_time_sk,t_hour,t_minute + hive.sql.query.fieldTypes int,int,int + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: t_time_sk (type: int), t_hour (type: int), t_minute (type: int) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col2 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: catalog_sales + Statistics: Num rows: 1 Data size: 124 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ext_price (type: decimal(7,2)), sold_item_sk (type: bigint), time_sk (type: int) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 124 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: bigint) + Statistics: Num rows: 3 Data size: 372 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(7,2)), _col2 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 8 + Map Operator Tree: + TableScan + alias: store_sales + Statistics: Num rows: 1 Data size: 124 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ext_price (type: decimal(7,2)), sold_item_sk (type: bigint), time_sk (type: int) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 124 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: bigint) + Statistics: Num rows: 3 Data size: 372 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(7,2)), _col2 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: item + properties: + hive.sql.query SELECT "i_item_sk", "i_brand_id", "i_brand" +FROM (SELECT "i_item_sk", "i_brand_id", "i_brand", "i_manager_id" +FROM "item") AS "t" +WHERE "i_manager_id" = 1 AND "i_item_sk" IS NOT NULL + hive.sql.query.fieldNames i_item_sk,i_brand_id,i_brand + hive.sql.query.fieldTypes bigint,int,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 196 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_sk (type: bigint), i_brand_id (type: int), i_brand (type: string) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 196 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 196 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col2 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col1 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col0, _col2, _col4, _col5 + Statistics: Num rows: 3 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col2 (type: int) + Statistics: Num rows: 3 Data size: 409 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(7,2)), _col4 (type: int), _col5 (type: string) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col2 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col0, _col4, _col5, _col7, _col8 + Statistics: Num rows: 3 Data size: 449 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col0) + keys: _col4 (type: int), _col5 (type: string), _col7 (type: int), _col8 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 3 Data size: 449 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: string), _col2 (type: int), _col3 (type: int) + null sort order: zzzz + sort order: ++++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: string), _col2 (type: int), _col3 (type: int) + Statistics: Num rows: 3 Data size: 449 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: decimal(17,2)) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: int), KEY._col1 (type: string), KEY._col2 (type: int), KEY._col3 (type: int) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: decimal(17,2)), _col0 (type: int) + outputColumnNames: _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col4 (type: decimal(17,2)), _col5 (type: int) + null sort order: az + sort order: -+ + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string), _col2 (type: int), _col3 (type: int) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey1 (type: int), VALUE._col0 (type: string), VALUE._col1 (type: int), VALUE._col2 (type: int), KEY.reducesinkkey0 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 149 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Union 2 + Vertex: Union 2 + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query72.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query72.q.out new file mode 100644 index 000000000000..64415ea67672 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query72.q.out @@ -0,0 +1,69 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t35"."$f0", "t35"."$f1", "t35"."$f2", "t35"."$f3", "t35"."$f4", "t35"."$f5" +FROM (SELECT "t29"."i_item_desc" AS "$f0", "t29"."w_warehouse_name" AS "$f1", "t29"."d_week_seq" AS "$f2", COUNT(CASE WHEN "t29"."p_promo_sk" IS NULL THEN 1 ELSE 0 END) AS "$f3", COUNT(CASE WHEN "t29"."p_promo_sk" IS NOT NULL THEN 1 ELSE 0 END) AS "$f4", COUNT(*) AS "$f5" +FROM (SELECT "t1"."cs_sold_date_sk", "t1"."cs_ship_date_sk", "t1"."cs_bill_cdemo_sk", "t1"."cs_bill_hdemo_sk", "t1"."cs_item_sk", "t1"."cs_promo_sk", "t1"."cs_order_number", "t1"."cs_quantity", "t22"."inv_date_sk", "t22"."inv_item_sk", "t22"."inv_warehouse_sk", "t22"."inv_quantity_on_hand", "t22"."w_warehouse_sk", "t22"."w_warehouse_name", "t13"."i_item_sk", "t13"."i_item_desc", "t4"."cd_demo_sk", "t7"."hd_demo_sk", "t25"."d_date_sk", "t25"."d_week_seq", "t25"."EXPR$0", "t22"."d_date_sk" AS "d_date_sk0", "t22"."d_week_seq" AS "d_week_seq0", "t28"."d_date_sk" AS "d_date_sk1", "t28"."EXPR$0" AS "EXPR$00", "t10"."p_promo_sk" +FROM (SELECT "cs_sold_date_sk", "cs_ship_date_sk", "cs_bill_cdemo_sk", "cs_bill_hdemo_sk", "cs_item_sk", "cs_promo_sk", "cs_order_number", "cs_quantity" +FROM (SELECT "cs_sold_date_sk", "cs_ship_date_sk", "cs_bill_cdemo_sk", "cs_bill_hdemo_sk", "cs_item_sk", "cs_promo_sk", "cs_order_number", "cs_quantity" +FROM "catalog_sales") AS "t" +WHERE "cs_item_sk" IS NOT NULL AND ("cs_bill_cdemo_sk" IS NOT NULL AND "cs_bill_hdemo_sk" IS NOT NULL) AND ("cs_sold_date_sk" IS NOT NULL AND ("cs_ship_date_sk" IS NOT NULL AND "cs_quantity" IS NOT NULL))) AS "t1" +INNER JOIN (SELECT "cd_demo_sk" +FROM (SELECT "cd_demo_sk", "cd_marital_status" +FROM "customer_demographics") AS "t2" +WHERE "cd_marital_status" = 'M' AND "cd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."cs_bill_cdemo_sk" = "t4"."cd_demo_sk" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_buy_potential" +FROM "household_demographics") AS "t5" +WHERE "hd_buy_potential" = '1001-5000' AND "hd_demo_sk" IS NOT NULL) AS "t7" ON "t1"."cs_bill_hdemo_sk" = "t7"."hd_demo_sk" +LEFT JOIN (SELECT "p_promo_sk" +FROM (SELECT "p_promo_sk" +FROM "promotion") AS "t8" +WHERE "p_promo_sk" IS NOT NULL) AS "t10" ON "t1"."cs_promo_sk" = "t10"."p_promo_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_desc" +FROM (SELECT "i_item_sk", "i_item_desc" +FROM "item") AS "t11" +WHERE "i_item_sk" IS NOT NULL) AS "t13" ON "t1"."cs_item_sk" = "t13"."i_item_sk" +INNER JOIN (SELECT "t15"."inv_date_sk", "t15"."inv_item_sk", "t15"."inv_warehouse_sk", "t15"."inv_quantity_on_hand", "t18"."d_date_sk", "t18"."d_week_seq", "t21"."w_warehouse_sk", "t21"."w_warehouse_name" +FROM (SELECT "inv_date_sk", "inv_item_sk", "inv_warehouse_sk", "inv_quantity_on_hand" +FROM "inventory" +WHERE "inv_item_sk" IS NOT NULL AND "inv_warehouse_sk" IS NOT NULL AND "inv_date_sk" IS NOT NULL AND "inv_quantity_on_hand" IS NOT NULL) AS "t15" +INNER JOIN (SELECT "d_date_sk", "d_week_seq" +FROM (SELECT "d_date_sk", "d_week_seq" +FROM "date_dim") AS "t16" +WHERE "d_date_sk" IS NOT NULL AND "d_week_seq" IS NOT NULL) AS "t18" ON "t15"."inv_date_sk" = "t18"."d_date_sk" +INNER JOIN (SELECT "w_warehouse_sk", "w_warehouse_name" +FROM (SELECT "w_warehouse_sk", "w_warehouse_name" +FROM "warehouse") AS "t19" +WHERE "w_warehouse_sk" IS NOT NULL) AS "t21" ON "t15"."inv_warehouse_sk" = "t21"."w_warehouse_sk") AS "t22" ON "t1"."cs_item_sk" = "t22"."inv_item_sk" AND "t1"."cs_quantity" > "t22"."inv_quantity_on_hand" +INNER JOIN (SELECT "d_date_sk", "d_week_seq", CAST("d_date" AS DOUBLE PRECISION) + 5 AS "EXPR$0" +FROM (SELECT "d_date_sk", "d_date", "d_week_seq", "d_year" +FROM "date_dim") AS "t23" +WHERE "d_year" = 2001 AND "d_date_sk" IS NOT NULL AND "d_week_seq" IS NOT NULL AND CAST("d_date" AS DOUBLE PRECISION) IS NOT NULL) AS "t25" ON "t22"."d_week_seq" = "t25"."d_week_seq" AND "t1"."cs_sold_date_sk" = "t25"."d_date_sk" +INNER JOIN (SELECT "d_date_sk", CAST("d_date" AS DOUBLE PRECISION) AS "EXPR$0" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t26" +WHERE "d_date_sk" IS NOT NULL AND CAST("d_date" AS DOUBLE PRECISION) IS NOT NULL) AS "t28" ON "t1"."cs_ship_date_sk" = "t28"."d_date_sk" AND "t25"."EXPR$0" < "t28"."EXPR$0") AS "t29" +LEFT JOIN (SELECT "cr_item_sk", "cr_order_number" +FROM (SELECT "cr_item_sk", "cr_order_number" +FROM "catalog_returns") AS "t30" +WHERE "cr_item_sk" IS NOT NULL AND "cr_order_number" IS NOT NULL) AS "t32" ON "t29"."cs_item_sk" = "t32"."cr_item_sk" AND "t29"."cs_order_number" = "t32"."cr_order_number" +GROUP BY "t29"."i_item_desc", "t29"."w_warehouse_name", "t29"."d_week_seq" +ORDER BY COUNT(*) DESC, "t29"."i_item_desc", "t29"."w_warehouse_name", "t29"."d_week_seq" +FETCH NEXT 100 ROWS ONLY) AS "t35" + hive.sql.query.fieldNames $f0,$f1,$f2,$f3,$f4,$f5 + hive.sql.query.fieldTypes string,string,int,bigint,bigint,bigint + hive.sql.query.split false + Select Operator + expressions: $f0 (type: string), $f1 (type: string), $f2 (type: int), $f3 (type: bigint), $f4 (type: bigint), $f5 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query73.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query73.q.out new file mode 100644 index 000000000000..d433df37a1f7 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query73.q.out @@ -0,0 +1,46 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "t19"."c_last_name", "t19"."c_first_name", "t19"."c_salutation", "t19"."c_preferred_cust_flag", "t19"."ss_ticket_number", "t19"."cnt" +FROM (SELECT "t1"."c_last_name", "t1"."c_first_name", "t1"."c_salutation", "t1"."c_preferred_cust_flag", "t17"."ss_ticket_number", "t17"."$f2" AS "cnt" +FROM (SELECT "c_customer_sk", "c_salutation", "c_first_name", "c_last_name", "c_preferred_cust_flag" +FROM (SELECT "c_customer_sk", "c_salutation", "c_first_name", "c_last_name", "c_preferred_cust_flag" +FROM "customer") AS "t" +WHERE "c_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ss_ticket_number", "ss_customer_sk", "$f2" +FROM (SELECT "t4"."ss_ticket_number", "t4"."ss_customer_sk", COUNT(*) AS "$f2" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_hdemo_sk", "ss_store_sk", "ss_ticket_number" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_hdemo_sk", "ss_store_sk", "ss_ticket_number" +FROM "store_sales") AS "t2" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL AND "ss_hdemo_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL) AS "t4" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_dom" +FROM "date_dim") AS "t5" +WHERE "d_year" IN (2000, 2001, 2002) AND "d_dom" BETWEEN 1 AND 2 AND "d_date_sk" IS NOT NULL) AS "t7" ON "t4"."ss_sold_date_sk" = "t7"."d_date_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_county" +FROM "store") AS "t8" +WHERE "s_county" IN ('Huron County', 'Kittitas County', 'Maverick County', 'Mobile County') AND "s_store_sk" IS NOT NULL) AS "t10" ON "t4"."ss_store_sk" = "t10"."s_store_sk" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_buy_potential", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t11" +WHERE "hd_vehicle_count" > 0 AND "hd_buy_potential" IN ('>10000', 'unknown') AND CASE WHEN "hd_vehicle_count" > 0 THEN CAST("hd_dep_count" AS DOUBLE PRECISION) / CAST("hd_vehicle_count" AS DOUBLE PRECISION) > 1 ELSE FALSE END AND "hd_demo_sk" IS NOT NULL) AS "t13" ON "t4"."ss_hdemo_sk" = "t13"."hd_demo_sk" +GROUP BY "t4"."ss_customer_sk", "t4"."ss_ticket_number") AS "t15" +WHERE "t15"."$f2" BETWEEN 1 AND 5) AS "t17" ON "t1"."c_customer_sk" = "t17"."ss_customer_sk" +ORDER BY "t17"."$f2" DESC) AS "t19" + hive.sql.query.fieldNames c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number,cnt + hive.sql.query.fieldTypes string,string,string,string,bigint,bigint + hive.sql.query.split false + Select Operator + expressions: c_last_name (type: string), c_first_name (type: string), c_salutation (type: string), c_preferred_cust_flag (type: string), ss_ticket_number (type: bigint), cnt (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query74.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query74.q.out new file mode 100644 index 000000000000..624afea25cc0 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query74.q.out @@ -0,0 +1,81 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t45"."customer_id", "t45"."customer_first_name", "t45"."customer_last_name" +FROM (SELECT "t43"."c_customer_id" AS "customer_id", "t43"."c_first_name" AS "customer_first_name", "t43"."c_last_name" AS "customer_last_name" +FROM (SELECT "t7"."c_customer_id" AS "customer_id", SUM("t1"."ss_net_paid") AS "year_total", SUM("t1"."ss_net_paid") > 0 AS "EXPR$0" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_net_paid" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_net_paid" +FROM "store_sales") AS "t" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t2" +WHERE "d_year" = 1998 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "c_customer_sk", "c_customer_id", "c_first_name", "c_last_name" +FROM (SELECT "c_customer_sk", "c_customer_id", "c_first_name", "c_last_name" +FROM "customer") AS "t5" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t7" ON "t1"."ss_customer_sk" = "t7"."c_customer_sk" +GROUP BY "t7"."c_customer_id", "t7"."c_first_name", "t7"."c_last_name" +HAVING SUM("t1"."ss_net_paid") > 0) AS "t10" +INNER JOIN (SELECT "t19"."c_customer_id" AS "customer_id", SUM("t13"."ws_net_paid") AS "year_total" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk", "ws_net_paid" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk", "ws_net_paid" +FROM "web_sales") AS "t11" +WHERE "ws_bill_customer_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t13" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t14" +WHERE "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t16" ON "t13"."ws_sold_date_sk" = "t16"."d_date_sk" +INNER JOIN (SELECT "c_customer_sk", "c_customer_id", "c_first_name", "c_last_name" +FROM (SELECT "c_customer_sk", "c_customer_id", "c_first_name", "c_last_name" +FROM "customer") AS "t17" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t19" ON "t13"."ws_bill_customer_sk" = "t19"."c_customer_sk" +GROUP BY "t19"."c_customer_id", "t19"."c_first_name", "t19"."c_last_name") AS "t21" ON "t10"."customer_id" = "t21"."customer_id" +INNER JOIN (SELECT "t30"."c_customer_id" AS "customer_id", SUM("t24"."ws_net_paid") AS "year_total", SUM("t24"."ws_net_paid") > 0 AS "EXPR$1" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk", "ws_net_paid" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk", "ws_net_paid" +FROM "web_sales") AS "t22" +WHERE "ws_bill_customer_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t24" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t25" +WHERE "d_year" = 1998 AND "d_date_sk" IS NOT NULL) AS "t27" ON "t24"."ws_sold_date_sk" = "t27"."d_date_sk" +INNER JOIN (SELECT "c_customer_sk", "c_customer_id", "c_first_name", "c_last_name" +FROM (SELECT "c_customer_sk", "c_customer_id", "c_first_name", "c_last_name" +FROM "customer") AS "t28" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t30" ON "t24"."ws_bill_customer_sk" = "t30"."c_customer_sk" +GROUP BY "t30"."c_customer_id", "t30"."c_first_name", "t30"."c_last_name" +HAVING SUM("t24"."ws_net_paid") > 0) AS "t33" ON "t10"."customer_id" = "t33"."customer_id" +INNER JOIN (SELECT "t42"."c_customer_id", "t42"."c_first_name", "t42"."c_last_name", SUM("t36"."ss_net_paid") AS "$f3" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_net_paid" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_net_paid" +FROM "store_sales") AS "t34" +WHERE "ss_customer_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t36" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t37" +WHERE "d_year" = 1999 AND "d_date_sk" IS NOT NULL) AS "t39" ON "t36"."ss_sold_date_sk" = "t39"."d_date_sk" +INNER JOIN (SELECT "c_customer_sk", "c_customer_id", "c_first_name", "c_last_name" +FROM (SELECT "c_customer_sk", "c_customer_id", "c_first_name", "c_last_name" +FROM "customer") AS "t40" +WHERE "c_customer_sk" IS NOT NULL AND "c_customer_id" IS NOT NULL) AS "t42" ON "t36"."ss_customer_sk" = "t42"."c_customer_sk" +GROUP BY "t42"."c_customer_id", "t42"."c_first_name", "t42"."c_last_name") AS "t43" ON "t10"."customer_id" = "t43"."c_customer_id" AND CASE WHEN "t10"."EXPR$0" THEN CASE WHEN "t33"."EXPR$1" THEN "t21"."year_total" / "t33"."year_total" > "t43"."$f3" / "t10"."year_total" ELSE FALSE END ELSE FALSE END +ORDER BY "t43"."c_last_name", "t43"."c_customer_id", "t43"."c_first_name" +FETCH NEXT 100 ROWS ONLY) AS "t45" + hive.sql.query.fieldNames customer_id,customer_first_name,customer_last_name + hive.sql.query.fieldTypes string,string,string + hive.sql.query.split false + Select Operator + expressions: customer_id (type: string), customer_first_name (type: string), customer_last_name (type: string) + outputColumnNames: _col0, _col1, _col2 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query75.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query75.q.out new file mode 100644 index 000000000000..a6a996b8a2dd --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query75.q.out @@ -0,0 +1,141 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT CAST(2001 AS INTEGER) AS "prev_year", CAST(2002 AS INTEGER) AS "year", "t94"."i_brand_id", "t94"."i_class_id", "t94"."i_category_id", "t94"."i_manufact_id", "t94"."prev_yr_cnt", "t94"."curr_yr_cnt", "t94"."sales_cnt_diff", "t94"."sales_amt_diff" +FROM (SELECT "t45"."i_brand_id", "t45"."i_class_id", "t45"."i_category_id", "t45"."i_manufact_id", "t92"."$f4" AS "prev_yr_cnt", "t45"."$f4" AS "curr_yr_cnt", "t45"."$f4" - "t92"."$f4" AS "sales_cnt_diff", "t45"."$f5" - "t92"."$f5" AS "sales_amt_diff" +FROM (SELECT "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id", SUM("sales_cnt") AS "$f4", SUM("sales_amt") AS "$f5" +FROM (SELECT "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id", "sales_cnt", "sales_amt" +FROM (SELECT "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id", "sales_cnt", "sales_amt" +FROM (SELECT "t10"."i_brand_id", "t10"."i_class_id", "t10"."i_category_id", "t10"."i_manufact_id", "t1"."cs_quantity" - CASE WHEN "t7"."cr_return_quantity" IS NOT NULL THEN "t7"."cr_return_quantity" ELSE 0 END AS "sales_cnt", "t1"."cs_ext_sales_price" - CASE WHEN "t7"."cr_return_amount" IS NOT NULL THEN "t7"."cr_return_amount" ELSE 0 END AS "sales_amt" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_order_number", "cs_quantity", "cs_ext_sales_price" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_order_number", "cs_quantity", "cs_ext_sales_price" +FROM "catalog_sales") AS "t" +WHERE "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2002 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_sold_date_sk" = "t4"."d_date_sk" +LEFT JOIN (SELECT "cr_item_sk", "cr_order_number", "cr_return_quantity", "cr_return_amount" +FROM (SELECT "cr_item_sk", "cr_order_number", "cr_return_quantity", "cr_return_amount" +FROM "catalog_returns") AS "t5" +WHERE "cr_order_number" IS NOT NULL AND "cr_item_sk" IS NOT NULL) AS "t7" ON "t1"."cs_order_number" = "t7"."cr_order_number" AND "t1"."cs_item_sk" = "t7"."cr_item_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id" +FROM (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id", "i_category", "i_manufact_id" +FROM "item") AS "t8" +WHERE "i_category" = 'Sports' AND ("i_item_sk" IS NOT NULL AND "i_brand_id" IS NOT NULL) AND ("i_class_id" IS NOT NULL AND ("i_category_id" IS NOT NULL AND "i_manufact_id" IS NOT NULL))) AS "t10" ON "t1"."cs_item_sk" = "t10"."i_item_sk" +UNION ALL +SELECT "t23"."i_brand_id", "t23"."i_class_id", "t23"."i_category_id", "t23"."i_manufact_id", "t14"."ss_quantity" - CASE WHEN "t20"."sr_return_quantity" IS NOT NULL THEN "t20"."sr_return_quantity" ELSE 0 END AS "sales_cnt", "t14"."ss_ext_sales_price" - CASE WHEN "t20"."sr_return_amt" IS NOT NULL THEN "t20"."sr_return_amt" ELSE 0 END AS "sales_amt" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ticket_number", "ss_quantity", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ticket_number", "ss_quantity", "ss_ext_sales_price" +FROM "store_sales") AS "t12" +WHERE "ss_item_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t14" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t15" +WHERE "d_year" = 2002 AND "d_date_sk" IS NOT NULL) AS "t17" ON "t14"."ss_sold_date_sk" = "t17"."d_date_sk" +LEFT JOIN (SELECT "sr_item_sk", "sr_ticket_number", "sr_return_quantity", "sr_return_amt" +FROM (SELECT "sr_item_sk", "sr_ticket_number", "sr_return_quantity", "sr_return_amt" +FROM "store_returns") AS "t18" +WHERE "sr_ticket_number" IS NOT NULL AND "sr_item_sk" IS NOT NULL) AS "t20" ON "t14"."ss_ticket_number" = "t20"."sr_ticket_number" AND "t14"."ss_item_sk" = "t20"."sr_item_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id" +FROM (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id", "i_category", "i_manufact_id" +FROM "item") AS "t21" +WHERE "i_category" = 'Sports' AND ("i_item_sk" IS NOT NULL AND "i_brand_id" IS NOT NULL) AND ("i_class_id" IS NOT NULL AND ("i_category_id" IS NOT NULL AND "i_manufact_id" IS NOT NULL))) AS "t23" ON "t14"."ss_item_sk" = "t23"."i_item_sk") AS "t25" +GROUP BY "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id", "sales_cnt", "sales_amt" +UNION ALL +SELECT "t40"."i_brand_id", "t40"."i_class_id", "t40"."i_category_id", "t40"."i_manufact_id", "t31"."ws_quantity" - CASE WHEN "t37"."wr_return_quantity" IS NOT NULL THEN "t37"."wr_return_quantity" ELSE 0 END AS "sales_cnt", "t31"."ws_ext_sales_price" - CASE WHEN "t37"."wr_return_amt" IS NOT NULL THEN "t37"."wr_return_amt" ELSE 0 END AS "sales_amt" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_order_number", "ws_quantity", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_order_number", "ws_quantity", "ws_ext_sales_price" +FROM "web_sales") AS "t29" +WHERE "ws_item_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t31" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t32" +WHERE "d_year" = 2002 AND "d_date_sk" IS NOT NULL) AS "t34" ON "t31"."ws_sold_date_sk" = "t34"."d_date_sk" +LEFT JOIN (SELECT "wr_item_sk", "wr_order_number", "wr_return_quantity", "wr_return_amt" +FROM (SELECT "wr_item_sk", "wr_order_number", "wr_return_quantity", "wr_return_amt" +FROM "web_returns") AS "t35" +WHERE "wr_order_number" IS NOT NULL AND "wr_item_sk" IS NOT NULL) AS "t37" ON "t31"."ws_order_number" = "t37"."wr_order_number" AND "t31"."ws_item_sk" = "t37"."wr_item_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id" +FROM (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id", "i_category", "i_manufact_id" +FROM "item") AS "t38" +WHERE "i_category" = 'Sports' AND ("i_item_sk" IS NOT NULL AND "i_brand_id" IS NOT NULL) AND ("i_class_id" IS NOT NULL AND ("i_category_id" IS NOT NULL AND "i_manufact_id" IS NOT NULL))) AS "t40" ON "t31"."ws_item_sk" = "t40"."i_item_sk") AS "t42" +GROUP BY "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id", "sales_cnt", "sales_amt") AS "t44" +GROUP BY "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id") AS "t45" +INNER JOIN (SELECT "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id", SUM("sales_cnt") AS "$f4", SUM("sales_amt") AS "$f5" +FROM (SELECT "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id", "sales_cnt", "sales_amt" +FROM (SELECT "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id", "sales_cnt", "sales_amt" +FROM (SELECT "t57"."i_brand_id", "t57"."i_class_id", "t57"."i_category_id", "t57"."i_manufact_id", "t48"."cs_quantity" - CASE WHEN "t54"."cr_return_quantity" IS NOT NULL THEN "t54"."cr_return_quantity" ELSE 0 END AS "sales_cnt", "t48"."cs_ext_sales_price" - CASE WHEN "t54"."cr_return_amount" IS NOT NULL THEN "t54"."cr_return_amount" ELSE 0 END AS "sales_amt" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_order_number", "cs_quantity", "cs_ext_sales_price" +FROM (SELECT "cs_sold_date_sk", "cs_item_sk", "cs_order_number", "cs_quantity", "cs_ext_sales_price" +FROM "catalog_sales") AS "t46" +WHERE "cs_item_sk" IS NOT NULL AND "cs_sold_date_sk" IS NOT NULL) AS "t48" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t49" +WHERE "d_year" = 2001 AND "d_date_sk" IS NOT NULL) AS "t51" ON "t48"."cs_sold_date_sk" = "t51"."d_date_sk" +LEFT JOIN (SELECT "cr_item_sk", "cr_order_number", "cr_return_quantity", "cr_return_amount" +FROM (SELECT "cr_item_sk", "cr_order_number", "cr_return_quantity", "cr_return_amount" +FROM "catalog_returns") AS "t52" +WHERE "cr_order_number" IS NOT NULL AND "cr_item_sk" IS NOT NULL) AS "t54" ON "t48"."cs_order_number" = "t54"."cr_order_number" AND "t48"."cs_item_sk" = "t54"."cr_item_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id" +FROM (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id", "i_category", "i_manufact_id" +FROM "item") AS "t55" +WHERE "i_category" = 'Sports' AND ("i_item_sk" IS NOT NULL AND "i_brand_id" IS NOT NULL) AND ("i_class_id" IS NOT NULL AND ("i_category_id" IS NOT NULL AND "i_manufact_id" IS NOT NULL))) AS "t57" ON "t48"."cs_item_sk" = "t57"."i_item_sk" +UNION ALL +SELECT "t70"."i_brand_id", "t70"."i_class_id", "t70"."i_category_id", "t70"."i_manufact_id", "t61"."ss_quantity" - CASE WHEN "t67"."sr_return_quantity" IS NOT NULL THEN "t67"."sr_return_quantity" ELSE 0 END AS "sales_cnt", "t61"."ss_ext_sales_price" - CASE WHEN "t67"."sr_return_amt" IS NOT NULL THEN "t67"."sr_return_amt" ELSE 0 END AS "sales_amt" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ticket_number", "ss_quantity", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ticket_number", "ss_quantity", "ss_ext_sales_price" +FROM "store_sales") AS "t59" +WHERE "ss_item_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t61" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t62" +WHERE "d_year" = 2001 AND "d_date_sk" IS NOT NULL) AS "t64" ON "t61"."ss_sold_date_sk" = "t64"."d_date_sk" +LEFT JOIN (SELECT "sr_item_sk", "sr_ticket_number", "sr_return_quantity", "sr_return_amt" +FROM (SELECT "sr_item_sk", "sr_ticket_number", "sr_return_quantity", "sr_return_amt" +FROM "store_returns") AS "t65" +WHERE "sr_ticket_number" IS NOT NULL AND "sr_item_sk" IS NOT NULL) AS "t67" ON "t61"."ss_ticket_number" = "t67"."sr_ticket_number" AND "t61"."ss_item_sk" = "t67"."sr_item_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id" +FROM (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id", "i_category", "i_manufact_id" +FROM "item") AS "t68" +WHERE "i_category" = 'Sports' AND ("i_item_sk" IS NOT NULL AND "i_brand_id" IS NOT NULL) AND ("i_class_id" IS NOT NULL AND ("i_category_id" IS NOT NULL AND "i_manufact_id" IS NOT NULL))) AS "t70" ON "t61"."ss_item_sk" = "t70"."i_item_sk") AS "t72" +GROUP BY "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id", "sales_cnt", "sales_amt" +UNION ALL +SELECT "t87"."i_brand_id", "t87"."i_class_id", "t87"."i_category_id", "t87"."i_manufact_id", "t78"."ws_quantity" - CASE WHEN "t84"."wr_return_quantity" IS NOT NULL THEN "t84"."wr_return_quantity" ELSE 0 END AS "sales_cnt", "t78"."ws_ext_sales_price" - CASE WHEN "t84"."wr_return_amt" IS NOT NULL THEN "t84"."wr_return_amt" ELSE 0 END AS "sales_amt" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_order_number", "ws_quantity", "ws_ext_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_order_number", "ws_quantity", "ws_ext_sales_price" +FROM "web_sales") AS "t76" +WHERE "ws_item_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t78" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t79" +WHERE "d_year" = 2001 AND "d_date_sk" IS NOT NULL) AS "t81" ON "t78"."ws_sold_date_sk" = "t81"."d_date_sk" +LEFT JOIN (SELECT "wr_item_sk", "wr_order_number", "wr_return_quantity", "wr_return_amt" +FROM (SELECT "wr_item_sk", "wr_order_number", "wr_return_quantity", "wr_return_amt" +FROM "web_returns") AS "t82" +WHERE "wr_order_number" IS NOT NULL AND "wr_item_sk" IS NOT NULL) AS "t84" ON "t78"."ws_order_number" = "t84"."wr_order_number" AND "t78"."ws_item_sk" = "t84"."wr_item_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id" +FROM (SELECT "i_item_sk", "i_brand_id", "i_class_id", "i_category_id", "i_category", "i_manufact_id" +FROM "item") AS "t85" +WHERE "i_category" = 'Sports' AND ("i_item_sk" IS NOT NULL AND "i_brand_id" IS NOT NULL) AND ("i_class_id" IS NOT NULL AND ("i_category_id" IS NOT NULL AND "i_manufact_id" IS NOT NULL))) AS "t87" ON "t78"."ws_item_sk" = "t87"."i_item_sk") AS "t89" +GROUP BY "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id", "sales_cnt", "sales_amt") AS "t91" +GROUP BY "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id") AS "t92" ON "t45"."i_brand_id" = "t92"."i_brand_id" AND "t45"."i_class_id" = "t92"."i_class_id" AND "t45"."i_category_id" = "t92"."i_category_id" AND "t45"."i_manufact_id" = "t92"."i_manufact_id" AND CAST("t45"."$f4" AS DECIMAL(17, 2)) / CAST("t92"."$f4" AS DECIMAL(17, 2)) < 0.9 +ORDER BY "t45"."$f4" - "t92"."$f4" +FETCH NEXT 100 ROWS ONLY) AS "t94" + hive.sql.query.fieldNames prev_year,year,i_brand_id,i_class_id,i_category_id,i_manufact_id,prev_yr_cnt,curr_yr_cnt,sales_cnt_diff,sales_amt_diff + hive.sql.query.fieldTypes int,int,int,int,int,int,bigint,bigint,bigint,decimal(19,2) + hive.sql.query.split false + Select Operator + expressions: prev_year (type: int), year (type: int), i_brand_id (type: int), i_class_id (type: int), i_category_id (type: int), i_manufact_id (type: int), prev_yr_cnt (type: bigint), curr_yr_cnt (type: bigint), sales_cnt_diff (type: bigint), sales_amt_diff (type: decimal(19,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query76.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query76.q.out new file mode 100644 index 000000000000..338aa6609a58 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query76.q.out @@ -0,0 +1,150 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Map 1 <- Union 2 (CONTAINS) + Map 5 <- Union 2 (CONTAINS) + Map 6 <- Union 2 (CONTAINS) + Reducer 3 <- Union 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: channel (type: string), col_name (type: string), d_year (type: int), d_qoy (type: int), i_category (type: string), ext_sales_price (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +++++ + keys: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + null sort order: zzzzz + Statistics: Num rows: 3 Data size: 2016 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: count(), sum(_col5) + keys: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 3 Data size: 2016 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + Statistics: Num rows: 3 Data size: 2016 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: bigint), _col6 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 5 + Map Operator Tree: + TableScan + alias: web_sales + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: channel (type: string), col_name (type: string), d_year (type: int), d_qoy (type: int), i_category (type: string), ext_sales_price (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +++++ + keys: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + null sort order: zzzzz + Statistics: Num rows: 3 Data size: 2016 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: count(), sum(_col5) + keys: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 3 Data size: 2016 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + Statistics: Num rows: 3 Data size: 2016 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: bigint), _col6 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: catalog_sales + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: channel (type: string), col_name (type: string), d_year (type: int), d_qoy (type: int), i_category (type: string), ext_sales_price (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +++++ + keys: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + null sort order: zzzzz + Statistics: Num rows: 3 Data size: 2016 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: count(), sum(_col5) + keys: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 3 Data size: 2016 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + null sort order: zzzzz + sort order: +++++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + Statistics: Num rows: 3 Data size: 2016 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: bigint), _col6 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0), sum(VALUE._col1) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: int), KEY._col3 (type: int), KEY._col4 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: int), _col3 (type: int), _col4 (type: string) + null sort order: zzzzz + sort order: +++++ + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: bigint), _col6 (type: decimal(17,2)) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: int), KEY.reducesinkkey3 (type: int), KEY.reducesinkkey4 (type: string), VALUE._col0 (type: bigint), VALUE._col1 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 672 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Union 2 + Vertex: Union 2 + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query77.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query77.q.out new file mode 100644 index 000000000000..5991399c843d --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query77.q.out @@ -0,0 +1,222 @@ +Warning: Shuffle Join MERGEJOIN[38][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 6' is a cross product +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Map 1 <- Union 2 (CONTAINS) + Map 8 <- Union 2 (CONTAINS) + Reducer 3 <- Union 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) + Reducer 6 <- Map 5 (XPROD_EDGE), Map 7 (XPROD_EDGE), Union 2 (CONTAINS) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + Statistics: Num rows: 1 Data size: 524 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: channel (type: string), id (type: int), sales (type: decimal(17,2)), returns (type: decimal(17,2)), profit (type: decimal(18,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 524 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: string), _col1 (type: int) + null sort order: zz + Statistics: Num rows: 3 Data size: 1501 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col2), sum(_col3), sum(_col4) + keys: _col0 (type: string), _col1 (type: int), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 9 Data size: 4503 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: bigint) + Statistics: Num rows: 9 Data size: 4503 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(27,2)), _col4 (type: decimal(27,2)), _col5 (type: decimal(28,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 5 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t1"."cs_call_center_sk", SUM("t1"."cs_ext_sales_price") AS "$f1", SUM("t1"."cs_net_profit") AS "$f2" +FROM (SELECT "cs_sold_date_sk", "cs_call_center_sk", "cs_ext_sales_price", "cs_net_profit" +FROM (SELECT "cs_sold_date_sk", "cs_call_center_sk", "cs_ext_sales_price", "cs_net_profit" +FROM "catalog_sales") AS "t" +WHERE "cs_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t2" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '1998-08-04 00:00:00.000000000' AND TIMESTAMP '1998-09-03 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_sold_date_sk" = "t4"."d_date_sk" +GROUP BY "t1"."cs_call_center_sk" + hive.sql.query.fieldNames cs_call_center_sk,$f1,$f2 + hive.sql.query.fieldTypes int,decimal(17,2),decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 228 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_call_center_sk (type: int), $f1 (type: decimal(17,2)), $f2 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 228 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 228 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col1 (type: decimal(17,2)), _col2 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: catalog_returns + properties: + hive.sql.query SELECT SUM("t1"."cr_return_amount") AS "$f0", SUM("t1"."cr_net_loss") AS "$f1" +FROM (SELECT "cr_returned_date_sk", "cr_return_amount", "cr_net_loss" +FROM (SELECT "cr_returned_date_sk", "cr_return_amount", "cr_net_loss" +FROM "catalog_returns") AS "t" +WHERE "cr_returned_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t2" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '1998-08-04 00:00:00.000000000' AND TIMESTAMP '1998-09-03 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cr_returned_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames $f0,$f1 + hive.sql.query.fieldTypes decimal(17,2),decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: decimal(17,2)), $f1 (type: decimal(17,2)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 224 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(17,2)), _col1 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 8 + Map Operator Tree: + TableScan + alias: web_sales + Statistics: Num rows: 1 Data size: 524 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: channel (type: string), id (type: int), sales (type: decimal(17,2)), returns (type: decimal(17,2)), profit (type: decimal(18,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 524 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: string), _col1 (type: int) + null sort order: zz + Statistics: Num rows: 3 Data size: 1501 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col2), sum(_col3), sum(_col4) + keys: _col0 (type: string), _col1 (type: int), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 9 Data size: 4503 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: bigint) + Statistics: Num rows: 9 Data size: 4503 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(27,2)), _col4 (type: decimal(27,2)), _col5 (type: decimal(28,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1), sum(VALUE._col2) + keys: KEY._col0 (type: string), KEY._col1 (type: int), KEY._col2 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col3, _col4, _col5 + Statistics: Num rows: 4 Data size: 2001 Basic stats: COMPLETE Column stats: NONE + pruneGroupingSetId: true + Select Operator + expressions: _col0 (type: string), _col1 (type: int), _col3 (type: decimal(27,2)), _col4 (type: decimal(27,2)), _col5 (type: decimal(28,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 4 Data size: 2001 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int) + null sort order: zz + sort order: ++ + Statistics: Num rows: 4 Data size: 2001 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(27,2)), _col3 (type: decimal(27,2)), _col4 (type: decimal(28,2)) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: int), VALUE._col0 (type: decimal(27,2)), VALUE._col1 (type: decimal(27,2)), VALUE._col2 (type: decimal(28,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 4 Data size: 2001 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 4 Data size: 2001 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 4 Data size: 2001 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 6 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 453 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'catalog channel' (type: string), _col0 (type: int), _col1 (type: decimal(17,2)), _col3 (type: decimal(17,2)), (_col2 - _col4) (type: decimal(18,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 453 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: string), _col1 (type: int) + null sort order: zz + Statistics: Num rows: 3 Data size: 1501 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col2), sum(_col3), sum(_col4) + keys: _col0 (type: string), _col1 (type: int), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 9 Data size: 4503 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: int), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: int), _col2 (type: bigint) + Statistics: Num rows: 9 Data size: 4503 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(27,2)), _col4 (type: decimal(27,2)), _col5 (type: decimal(28,2)) + Union 2 + Vertex: Union 2 + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query78.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query78.q.out new file mode 100644 index 000000000000..c90c76a8cd28 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query78.q.out @@ -0,0 +1,514 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 10 <- Map 13 (SIMPLE_EDGE), Map 9 (SIMPLE_EDGE) + Reducer 11 <- Map 14 (SIMPLE_EDGE), Reducer 10 (SIMPLE_EDGE) + Reducer 12 <- Reducer 11 (SIMPLE_EDGE) + Reducer 15 <- Map 14 (SIMPLE_EDGE), Reducer 18 (SIMPLE_EDGE) + Reducer 16 <- Reducer 15 (SIMPLE_EDGE) + Reducer 18 <- Map 17 (SIMPLE_EDGE), Map 19 (SIMPLE_EDGE) + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE) + Reducer 3 <- Map 14 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 12 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 16 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE) + Reducer 7 <- Reducer 6 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_ticket_number", "ss_quantity", "ss_wholesale_cost", "ss_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk", "ss_ticket_number", "ss_quantity", "ss_wholesale_cost", "ss_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_item_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL + hive.sql.query.fieldNames ss_sold_date_sk,ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price + hive.sql.query.fieldTypes int,bigint,int,bigint,int,decimal(7,2),decimal(7,2) + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 252 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_sold_date_sk (type: int), ss_item_sk (type: bigint), ss_customer_sk (type: int), ss_ticket_number (type: bigint), ss_quantity (type: int), ss_wholesale_cost (type: decimal(7,2)), ss_sales_price (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 252 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: bigint), _col3 (type: bigint) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col1 (type: bigint), _col3 (type: bigint) + Statistics: Num rows: 1 Data size: 252 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col2 (type: int), _col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 13 + Map Operator Tree: + TableScan + alias: web_returns + properties: + hive.sql.query SELECT "wr_item_sk", "wr_order_number" +FROM (SELECT "wr_item_sk", "wr_order_number" +FROM "web_returns") AS "t" +WHERE "wr_order_number" IS NOT NULL AND "wr_item_sk" IS NOT NULL + hive.sql.query.fieldNames wr_item_sk,wr_order_number + hive.sql.query.fieldTypes bigint,bigint + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: wr_item_sk (type: bigint), wr_order_number (type: bigint) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: bigint), _col1 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint), _col1 (type: bigint) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col0 (type: bigint), _col1 (type: bigint) + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 14 + Map Operator Tree: + TableScan + alias: date_dim + properties: + hive.sql.query SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t" +WHERE "d_year" = 2000 AND "d_date_sk" IS NOT NULL + hive.sql.query.fieldNames d_date_sk + hive.sql.query.fieldTypes int + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: d_date_sk (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 17 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk", "cs_order_number", "cs_quantity", "cs_wholesale_cost", "cs_sales_price" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk", "cs_order_number", "cs_quantity", "cs_wholesale_cost", "cs_sales_price" +FROM "catalog_sales") AS "t" +WHERE "cs_sold_date_sk" IS NOT NULL AND "cs_item_sk" IS NOT NULL AND "cs_bill_customer_sk" IS NOT NULL + hive.sql.query.fieldNames cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price + hive.sql.query.fieldTypes int,int,bigint,bigint,int,decimal(7,2),decimal(7,2) + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 252 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_sold_date_sk (type: int), cs_bill_customer_sk (type: int), cs_item_sk (type: bigint), cs_order_number (type: bigint), cs_quantity (type: int), cs_wholesale_cost (type: decimal(7,2)), cs_sales_price (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 252 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: bigint), _col3 (type: bigint) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col2 (type: bigint), _col3 (type: bigint) + Statistics: Num rows: 1 Data size: 252 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col1 (type: int), _col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 19 + Map Operator Tree: + TableScan + alias: catalog_returns + properties: + hive.sql.query SELECT "cr_item_sk", "cr_order_number" +FROM (SELECT "cr_item_sk", "cr_order_number" +FROM "catalog_returns") AS "t" +WHERE "cr_order_number" IS NOT NULL AND "cr_item_sk" IS NOT NULL + hive.sql.query.fieldNames cr_item_sk,cr_order_number + hive.sql.query.fieldTypes bigint,bigint + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cr_item_sk (type: bigint), cr_order_number (type: bigint) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: bigint), _col1 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint), _col1 (type: bigint) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col0 (type: bigint), _col1 (type: bigint) + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 8 + Map Operator Tree: + TableScan + alias: store_returns + properties: + hive.sql.query SELECT "sr_item_sk", "sr_ticket_number" +FROM (SELECT "sr_item_sk", "sr_ticket_number" +FROM "store_returns") AS "t" +WHERE "sr_ticket_number" IS NOT NULL AND "sr_item_sk" IS NOT NULL + hive.sql.query.fieldNames sr_item_sk,sr_ticket_number + hive.sql.query.fieldTypes bigint,bigint + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: sr_item_sk (type: bigint), sr_ticket_number (type: bigint) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: bigint), _col1 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint), _col1 (type: bigint) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col0 (type: bigint), _col1 (type: bigint) + Statistics: Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_customer_sk", "ws_order_number", "ws_quantity", "ws_wholesale_cost", "ws_sales_price" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_bill_customer_sk", "ws_order_number", "ws_quantity", "ws_wholesale_cost", "ws_sales_price" +FROM "web_sales") AS "t" +WHERE "ws_sold_date_sk" IS NOT NULL AND "ws_item_sk" IS NOT NULL AND "ws_bill_customer_sk" IS NOT NULL + hive.sql.query.fieldNames ws_sold_date_sk,ws_item_sk,ws_bill_customer_sk,ws_order_number,ws_quantity,ws_wholesale_cost,ws_sales_price + hive.sql.query.fieldTypes int,bigint,int,bigint,int,decimal(7,2),decimal(7,2) + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 252 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_sold_date_sk (type: int), ws_item_sk (type: bigint), ws_bill_customer_sk (type: int), ws_order_number (type: bigint), ws_quantity (type: int), ws_wholesale_cost (type: decimal(7,2)), ws_sales_price (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 252 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: bigint), _col3 (type: bigint) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col1 (type: bigint), _col3 (type: bigint) + Statistics: Num rows: 1 Data size: 252 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col2 (type: int), _col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 10 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Anti Join 0 to 1 + keys: + 0 _col1 (type: bigint), _col3 (type: bigint) + 1 _col0 (type: bigint), _col1 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 277 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: int), _col1 (type: bigint), _col2 (type: int), _col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 277 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 277 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint), _col2 (type: int), _col3 (type: int), _col4 (type: decimal(7,2)), _col5 (type: decimal(7,2)) + Reducer 11 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3), sum(_col4), sum(_col5) + keys: _col2 (type: int), _col1 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: bigint) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: bigint) + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: bigint), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)) + Reducer 12 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1), sum(VALUE._col2) + keys: KEY._col0 (type: int), KEY._col1 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (_col2 > 0L) (type: boolean) + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col1 (type: bigint), _col0 (type: int), _col2 (type: bigint), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int), _col0 (type: bigint) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col1 (type: int), _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: bigint), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)) + Reducer 15 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3), sum(_col4), sum(_col5) + keys: _col1 (type: int), _col2 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: bigint) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: bigint) + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: bigint), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)) + Reducer 16 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1), sum(VALUE._col2) + keys: KEY._col0 (type: int), KEY._col1 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: int), _col2 (type: bigint), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)) + outputColumnNames: _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (_col2 > 0L) (type: boolean) + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col1 (type: int), _col2 (type: bigint), _col2 is not null (type: boolean), if(_col2 is not null, _col2, 0L) (type: bigint), if(_col3 is not null, _col3, 0) (type: decimal(17,2)), if(_col4 is not null, _col4, 0) (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint), _col2 (type: boolean), _col3 (type: bigint), _col4 (type: decimal(17,2)), _col5 (type: decimal(17,2)) + Reducer 18 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Anti Join 0 to 1 + keys: + 0 _col2 (type: bigint), _col3 (type: bigint) + 1 _col0 (type: bigint), _col1 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 277 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: int), _col1 (type: int), _col2 (type: bigint), _col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 277 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 277 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col2 (type: bigint), _col3 (type: int), _col4 (type: decimal(7,2)), _col5 (type: decimal(7,2)) + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Anti Join 0 to 1 + keys: + 0 _col1 (type: bigint), _col3 (type: bigint) + 1 _col0 (type: bigint), _col1 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 277 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: int), _col1 (type: bigint), _col2 (type: int), _col4 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 277 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 277 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint), _col2 (type: int), _col3 (type: int), _col4 (type: decimal(7,2)), _col5 (type: decimal(7,2)) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col3), sum(_col4), sum(_col5) + keys: _col2 (type: int), _col1 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int), _col1 (type: bigint) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col0 (type: int), _col1 (type: bigint) + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: bigint), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1), sum(VALUE._col2) + keys: KEY._col0 (type: int), KEY._col1 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col1 (type: bigint), _col0 (type: int), _col2 (type: bigint), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int), _col0 (type: bigint) + null sort order: zz + sort order: ++ + Map-reduce partition columns: _col1 (type: int), _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 304 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: bigint), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)) + Reducer 5 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col1 (type: int), _col0 (type: bigint) + 1 _col1 (type: int), _col0 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col7, _col8, _col9 + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 334 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col2 (type: bigint), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col7 (type: bigint), _col8 (type: decimal(17,2)), _col9 (type: decimal(17,2)) + Reducer 6 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col1 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col7, _col8, _col9, _col11, _col12, _col13, _col14, _col15 + Statistics: Num rows: 1 Data size: 367 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++---++++ + keys: _col0 (type: bigint), _col1 (type: int), _col2 (type: bigint), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), (if(_col7 is not null, _col7, 0L) + _col13) (type: bigint), (if(_col8 is not null, _col8, 0) + _col14) (type: decimal(18,2)), (if(_col9 is not null, _col9, 0) + _col15) (type: decimal(18,2)), round((UDFToDouble(_col2) / UDFToDouble(if((_col12 and _col7 is not null), (_col7 + _col11), 1L))), 2) (type: double) + null sort order: zzaaazzzz + Statistics: Num rows: 1 Data size: 367 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col0 (type: bigint), _col1 (type: int), (if(_col7 is not null, _col7, 0L) + _col13) (type: bigint), (if(_col8 is not null, _col8, 0) + _col14) (type: decimal(18,2)), (if(_col9 is not null, _col9, 0) + _col15) (type: decimal(18,2)), _col2 (type: bigint), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), round((UDFToDouble(_col2) / UDFToDouble(if((_col12 and _col7 is not null), (_col7 + _col11), 1L))), 2) (type: double) + outputColumnNames: _col0, _col1, _col6, _col7, _col8, _col9, _col10, _col11, _col12 + Statistics: Num rows: 1 Data size: 367 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint), _col1 (type: int), _col9 (type: bigint), _col10 (type: decimal(17,2)), _col11 (type: decimal(17,2)), _col6 (type: bigint), _col7 (type: decimal(18,2)), _col8 (type: decimal(18,2)), _col12 (type: double) + null sort order: zzaaazzzz + sort order: ++---++++ + Statistics: Num rows: 1 Data size: 367 Basic stats: COMPLETE Column stats: NONE + Reducer 7 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: bigint), KEY.reducesinkkey1 (type: int), KEY.reducesinkkey8 (type: double), KEY.reducesinkkey2 (type: bigint), KEY.reducesinkkey3 (type: decimal(17,2)), KEY.reducesinkkey4 (type: decimal(17,2)), KEY.reducesinkkey5 (type: bigint), KEY.reducesinkkey6 (type: decimal(18,2)), KEY.reducesinkkey7 (type: decimal(18,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 1 Data size: 367 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 367 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 2000 (type: int), _col0 (type: bigint), _col1 (type: int), _col2 (type: double), _col3 (type: bigint), _col4 (type: decimal(17,2)), _col5 (type: decimal(17,2)), _col6 (type: bigint), _col7 (type: decimal(18,2)), _col8 (type: decimal(18,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + Statistics: Num rows: 1 Data size: 367 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 367 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query79.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query79.q.out new file mode 100644 index 000000000000..5a6504e98f1e --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query79.q.out @@ -0,0 +1,130 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 4 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_customer_sk", "t1"."ss_addr_sk", "t1"."ss_ticket_number", "t10"."s_city", SUM("t1"."ss_coupon_amt") AS "$f4", SUM("t1"."ss_net_profit") AS "$f5" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_hdemo_sk", "ss_addr_sk", "ss_store_sk", "ss_ticket_number", "ss_coupon_amt", "ss_net_profit" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk", "ss_hdemo_sk", "ss_addr_sk", "ss_store_sk", "ss_ticket_number", "ss_coupon_amt", "ss_net_profit" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL AND "ss_hdemo_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_dow" +FROM "date_dim") AS "t2" +WHERE "d_year" IN (1998, 1999, 2000) AND "d_dow" = 1 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t5" +WHERE ("hd_dep_count" = 8 OR "hd_vehicle_count" > 0) AND "hd_demo_sk" IS NOT NULL) AS "t7" ON "t1"."ss_hdemo_sk" = "t7"."hd_demo_sk" +INNER JOIN (SELECT "s_store_sk", "s_city" +FROM (SELECT "s_store_sk", "s_number_employees", "s_city" +FROM "store") AS "t8" +WHERE "s_number_employees" BETWEEN 200 AND 295 AND "s_store_sk" IS NOT NULL) AS "t10" ON "t1"."ss_store_sk" = "t10"."s_store_sk" +GROUP BY "t1"."ss_customer_sk", "t1"."ss_addr_sk", "t1"."ss_ticket_number", "t10"."s_city" + hive.sql.query.fieldNames ss_customer_sk,ss_addr_sk,ss_ticket_number,s_city,$f4,$f5 + hive.sql.query.fieldTypes int,int,bigint,string,decimal(17,2),decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 420 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_ticket_number (type: bigint), ss_customer_sk (type: int), $f4 (type: decimal(17,2)), $f5 (type: decimal(17,2)), substr(s_city, 1, 30) (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 420 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 420 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col2 (type: decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 4 + Map Operator Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "c_customer_sk", "c_first_name", "c_last_name" +FROM (SELECT "c_customer_sk", "c_first_name", "c_last_name" +FROM "customer") AS "t" +WHERE "c_customer_sk" IS NOT NULL + hive.sql.query.fieldNames c_customer_sk,c_first_name,c_last_name + hive.sql.query.fieldTypes int,string,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_customer_sk (type: int), c_first_name (type: string), c_last_name (type: string) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string), _col2 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col1 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col0, _col2, _col3, _col4, _col6, _col7 + Statistics: Num rows: 1 Data size: 462 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++++ + keys: _col7 (type: string), _col6 (type: string), _col4 (type: string), _col3 (type: decimal(17,2)) + null sort order: zzzz + Statistics: Num rows: 1 Data size: 462 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col7 (type: string), _col6 (type: string), _col0 (type: bigint), _col2 (type: decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: string) + outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 462 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col6 (type: string), _col5 (type: decimal(17,2)) + null sort order: zzzz + sort order: ++++ + Statistics: Num rows: 1 Data size: 462 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint), _col4 (type: decimal(17,2)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), VALUE._col0 (type: bigint), VALUE._col1 (type: decimal(17,2)), KEY.reducesinkkey3 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 462 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 462 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 462 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query8.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query8.q.out new file mode 100644 index 000000000000..8690133b401c --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query8.q.out @@ -0,0 +1,389 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 11 <- Map 10 (SIMPLE_EDGE), Map 14 (SIMPLE_EDGE) + Reducer 12 <- Reducer 11 (SIMPLE_EDGE) + Reducer 13 <- Reducer 12 (SIMPLE_EDGE), Union 8 (CONTAINS) + Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE) + Reducer 3 <- Map 15 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE) + Reducer 7 <- Map 6 (SIMPLE_EDGE), Union 8 (CONTAINS) + Reducer 9 <- Union 8 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store + properties: + hive.sql.query SELECT "s_store_sk", "s_store_name", "s_zip" +FROM (SELECT "s_store_sk", "s_store_name", "s_zip" +FROM "store") AS "t" +WHERE "s_store_sk" IS NOT NULL + hive.sql.query.fieldNames s_store_sk,s_store_name,s_zip + hive.sql.query.fieldTypes int,string,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: s_store_sk (type: int), s_store_name (type: string), s_zip (type: string) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: substr(_col2, 1, 2) is not null (type: boolean) + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: int), _col1 (type: string), substr(_col2, 1, 2) (type: string) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col2 (type: string) + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 10 + Map Operator Tree: + TableScan + alias: customer_address + properties: + hive.sql.query SELECT "ca_address_sk", "ca_zip" +FROM (SELECT "ca_address_sk", "ca_zip" +FROM "customer_address") AS "t" +WHERE "ca_address_sk" IS NOT NULL + hive.sql.query.fieldNames ca_address_sk,ca_zip + hive.sql.query.fieldTypes int,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ca_address_sk (type: int), ca_zip (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: substr(substr(_col1, 1, 5), 1, 2) is not null (type: boolean) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 14 + Map Operator Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "c_current_addr_sk" +FROM (SELECT "c_current_addr_sk", "c_preferred_cust_flag" +FROM "customer") AS "t" +WHERE "c_preferred_cust_flag" = 'Y' AND "c_current_addr_sk" IS NOT NULL + hive.sql.query.fieldNames c_current_addr_sk + hive.sql.query.fieldTypes int + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_current_addr_sk (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 15 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t1"."ss_sold_date_sk", "t1"."ss_store_sk", "t1"."ss_net_profit", "t4"."d_date_sk" +FROM (SELECT "ss_sold_date_sk", "ss_store_sk", "ss_net_profit" +FROM (SELECT "ss_sold_date_sk", "ss_store_sk", "ss_net_profit" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_qoy" +FROM "date_dim") AS "t2" +WHERE "d_qoy" = 1 AND "d_year" = 2002 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames ss_sold_date_sk,ss_store_sk,ss_net_profit,d_date_sk + hive.sql.query.fieldTypes int,int,decimal(7,2),int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ss_store_sk (type: int), ss_net_profit (type: decimal(7,2)) + outputColumnNames: _col1, _col2 + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 116 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: customer_address + properties: + hive.sql.query SELECT "ca_zip" +FROM "customer_address" + hive.sql.query.fieldNames ca_zip + hive.sql.query.fieldTypes string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ca_zip (type: string) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: ((substr(_col0, 1, 5)) IN ('89436', '30868', '65085', '22977', '83927', '77557', '58429', '40697', '80614', '10502', '32779', '91137', '61265', '98294', '17921', '18427', '21203', '59362', '87291', '84093', '21505', '17184', '10866', '67898', '25797', '28055', '18377', '80332', '74535', '21757', '29742', '90885', '29898', '17819', '40811', '25990', '47513', '89531', '91068', '10391', '18846', '99223', '82637', '41368', '83658', '86199', '81625', '26696', '89338', '88425', '32200', '81427', '19053', '77471', '36610', '99823', '43276', '41249', '48584', '83550', '82276', '18842', '78890', '14090', '38123', '40936', '34425', '19850', '43286', '80072', '79188', '54191', '11395', '50497', '84861', '90733', '21068', '57666', '37119', '25004', '57835', '70067', '62878', '95806', '19303', '18840', '19124', '29785', '16737', '16022', '49613', '89977', '68310', '60069', '98360', '48649', '39050', '41793', '25002', '27413', '39736', '47208', '16515', '94808', '57648', '15009', '80015', '42961', '63982', '21744', '71853', '81087', '67468', '34175', '64008', '20261', '11201', '51799', '48043', '45645', '61163', '48375', '36447', '57042', '21218', '41100', '89951', '22745', '35851', '83326', '61125', '78298', '80752', '49858', '52940', '96976', '63792', '11376', '53582', '18717', '90226', '50530', '94203', '99447', '27670', '96577', '57856', '56372', '16165', '23427', '54561', '28806', '44439', '22926', '30123', '61451', '92397', '56979', '92309', '70873', '13355', '21801', '46346', '37562', '56458', '28286', '47306', '99555', '69399', '26234', '47546', '49661', '88601', '35943', '39936', '25632', '24611', '44166', '56648', '30379', '59785', '11110', '14329', '93815', '52226', '71381', '13842', '25612', '63294', '14664', '21077', '82626', '18799', '60915', '81020', '56447', '76619', '11433', '13414', '42548', '92713', '70467', '30884', '47484', '16072', '38936', '13036', '88376', '45539', '35901', '19506', '65690', '73957', '71850', '49231', '14276', '20005', '18384', '76615', '11635', '38177', '55607', '41369', '95447', '58581', '58149', '91946', '33790', '76232', '75692', '95464', '22246', '51061', '56692', '53121', '77209', '15482', '10688', '14868', '45907', '73520', '72666', '25734', '17959', '24677', '66446', '94627', '53535', '15560', '41967', '69297', '11929', '59403', '33283', '52232', '57350', '43933', '40921', '36635', '10827', '71286', '19736', '80619', '25251', '95042', '15526', '36496', '55854', '49124', '81980', '35375', '49157', '63512', '28944', '14946', '36503', '54010', '18767', '23969', '43905', '66979', '33113', '21286', '58471', '59080', '13395', '79144', '70373', '67031', '38360', '26705', '50906', '52406', '26066', '73146', '15884', '31897', '30045', '61068', '45550', '92454', '13376', '14354', '19770', '22928', '97790', '50723', '46081', '30202', '14410', '20223', '88500', '67298', '13261', '14172', '81410', '93578', '83583', '46047', '94167', '82564', '21156', '15799', '86709', '37931', '74703', '83103', '23054', '70470', '72008', '49247', '91911', '69998', '20961', '70070', '63197', '54853', '88191', '91830', '49521', '19454', '81450', '89091', '62378', '25683', '61869', '51744', '36580', '85778', '36871', '48121', '28810', '83712', '45486', '67393', '26935', '42393', '20132', '55349', '86057', '21309', '80218', '10094', '11357', '48819', '39734', '40758', '30432', '21204', '29467', '30214', '61024', '55307', '74621', '11622', '68908', '33032', '52868', '99194', '99900', '84936', '69036', '99149', '45013', '32895', '59004', '32322', '14933', '32936', '33562', '72550', '27385', '58049', '58200', '16808', '21360', '32961', '18586', '79307', '15492') and substr(substr(_col0, 1, 5), 1, 2) is not null) (type: boolean) + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: substr(_col0, 1, 5) (type: string) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count() + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 11 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col1 + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count() + keys: _col1 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint) + Reducer 12 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (_col1 > 10L) (type: boolean) + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: substr(_col0, 1, 5) (type: string) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count() + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint) + Reducer 13 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count(_col1) + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 2 Data size: 390 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 2 Data size: 390 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint) + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col2 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col1 (type: int) + outputColumnNames: _col1, _col6 + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: + + keys: _col1 (type: string) + null sort order: z + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col6) + keys: _col1 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: decimal(17,2)) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: decimal(17,2)) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 7 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count(_col1) + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 2 Data size: 390 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 2 Data size: 390 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint) + Reducer 9 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 195 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: (_col1 = 2L) (type: boolean) + Statistics: Num rows: 1 Data size: 195 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: substr(_col0, 1, 2) (type: string) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 195 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 195 Basic stats: COMPLETE Column stats: NONE + Union 8 + Vertex: Union 8 + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query80.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query80.q.out new file mode 100644 index 000000000000..2fe50ff34af2 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query80.q.out @@ -0,0 +1,158 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Map 1 <- Union 2 (CONTAINS) + Map 5 <- Union 2 (CONTAINS) + Map 6 <- Union 2 (CONTAINS) + Reducer 3 <- Union 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + Statistics: Num rows: 1 Data size: 520 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'store channel' (type: string), concat('store', $f0) (type: string), $f1 (type: decimal(17,2)), $f2 (type: decimal(22,2)), $f3 (type: decimal(23,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 520 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: string), _col1 (type: string) + null sort order: zz + Statistics: Num rows: 3 Data size: 1560 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col2), sum(_col3), sum(_col4) + keys: _col0 (type: string), _col1 (type: string), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 9 Data size: 4680 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + Statistics: Num rows: 9 Data size: 4680 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(27,2)), _col4 (type: decimal(32,2)), _col5 (type: decimal(33,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 5 + Map Operator Tree: + TableScan + alias: catalog_sales + Statistics: Num rows: 1 Data size: 520 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'catalog channel' (type: string), concat('catalog_page', $f0) (type: string), $f1 (type: decimal(17,2)), $f2 (type: decimal(22,2)), $f3 (type: decimal(23,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 520 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: string), _col1 (type: string) + null sort order: zz + Statistics: Num rows: 3 Data size: 1560 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col2), sum(_col3), sum(_col4) + keys: _col0 (type: string), _col1 (type: string), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 9 Data size: 4680 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + Statistics: Num rows: 9 Data size: 4680 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(27,2)), _col4 (type: decimal(32,2)), _col5 (type: decimal(33,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: web_sales + Statistics: Num rows: 1 Data size: 520 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: 'web channel' (type: string), concat('web_site', $f0) (type: string), $f1 (type: decimal(17,2)), $f2 (type: decimal(22,2)), $f3 (type: decimal(23,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 520 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: string), _col1 (type: string) + null sort order: zz + Statistics: Num rows: 3 Data size: 1560 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col2), sum(_col3), sum(_col4) + keys: _col0 (type: string), _col1 (type: string), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 9 Data size: 4680 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + Statistics: Num rows: 9 Data size: 4680 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(27,2)), _col4 (type: decimal(32,2)), _col5 (type: decimal(33,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1), sum(VALUE._col2) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col3, _col4, _col5 + Statistics: Num rows: 4 Data size: 2080 Basic stats: COMPLETE Column stats: NONE + pruneGroupingSetId: true + Select Operator + expressions: _col0 (type: string), _col1 (type: string), _col3 (type: decimal(27,2)), _col4 (type: decimal(32,2)), _col5 (type: decimal(33,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 4 Data size: 2080 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string) + null sort order: zz + sort order: ++ + Statistics: Num rows: 4 Data size: 2080 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(27,2)), _col3 (type: decimal(32,2)), _col4 (type: decimal(33,2)) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), VALUE._col0 (type: decimal(27,2)), VALUE._col1 (type: decimal(32,2)), VALUE._col2 (type: decimal(33,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 4 Data size: 2080 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 4 Data size: 2080 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 4 Data size: 2080 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Union 2 + Vertex: Union 2 + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query81.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query81.q.out new file mode 100644 index 000000000000..49152d48157a --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query81.q.out @@ -0,0 +1,64 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: customer_address + properties: + hive.sql.query SELECT "t32"."c_customer_id", "t32"."c_salutation", "t32"."c_first_name", "t32"."c_last_name", "t32"."ca_street_number", "t32"."ca_street_name", "t32"."ca_street_type", "t32"."ca_suite_number", "t32"."ca_city", "t32"."ca_county", CAST('IL' AS VARCHAR(10485760)) AS "ca_state", "t32"."ca_zip", "t32"."ca_country", "t32"."ca_gmt_offset", "t32"."ca_location_type", "t32"."ctr_total_return" +FROM (SELECT "t4"."c_customer_id", "t4"."c_salutation", "t4"."c_first_name", "t4"."c_last_name", "t1"."ca_street_number", "t1"."ca_street_name", "t1"."ca_street_type", "t1"."ca_suite_number", "t1"."ca_city", "t1"."ca_county", "t1"."ca_zip", "t1"."ca_country", "t1"."ca_gmt_offset", "t1"."ca_location_type", "t30"."$f2" AS "ctr_total_return" +FROM (SELECT "ca_address_sk", "ca_street_number", "ca_street_name", "ca_street_type", "ca_suite_number", "ca_city", "ca_county", "ca_zip", "ca_country", "ca_gmt_offset", "ca_location_type" +FROM (SELECT "ca_address_sk", "ca_street_number", "ca_street_name", "ca_street_type", "ca_suite_number", "ca_city", "ca_county", "ca_state", "ca_zip", "ca_country", "ca_gmt_offset", "ca_location_type" +FROM "customer_address") AS "t" +WHERE "ca_state" = 'IL' AND "ca_address_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "c_customer_sk", "c_customer_id", "c_current_addr_sk", "c_salutation", "c_first_name", "c_last_name" +FROM (SELECT "c_customer_sk", "c_customer_id", "c_current_addr_sk", "c_salutation", "c_first_name", "c_last_name" +FROM "customer") AS "t2" +WHERE "c_current_addr_sk" IS NOT NULL AND "c_customer_sk" IS NOT NULL) AS "t4" ON "t1"."ca_address_sk" = "t4"."c_current_addr_sk" +INNER JOIN (SELECT "t16"."cr_returning_customer_sk", "t16"."ca_state", "t16"."$f2", "t29"."_o__c0", "t29"."ctr_state" +FROM (SELECT "t7"."cr_returning_customer_sk", "t13"."ca_state", SUM("t7"."cr_return_amt_inc_tax") AS "$f2" +FROM (SELECT "cr_returned_date_sk", "cr_returning_customer_sk", "cr_returning_addr_sk", "cr_return_amt_inc_tax" +FROM (SELECT "cr_returned_date_sk", "cr_returning_customer_sk", "cr_returning_addr_sk", "cr_return_amt_inc_tax" +FROM "catalog_returns") AS "t5" +WHERE "cr_returned_date_sk" IS NOT NULL AND "cr_returning_addr_sk" IS NOT NULL AND "cr_returning_customer_sk" IS NOT NULL) AS "t7" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t8" +WHERE "d_year" = 1998 AND "d_date_sk" IS NOT NULL) AS "t10" ON "t7"."cr_returned_date_sk" = "t10"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_state" +FROM (SELECT "ca_address_sk", "ca_state" +FROM "customer_address") AS "t11" +WHERE "ca_address_sk" IS NOT NULL AND "ca_state" IS NOT NULL) AS "t13" ON "t7"."cr_returning_addr_sk" = "t13"."ca_address_sk" +GROUP BY "t7"."cr_returning_customer_sk", "t13"."ca_state" +HAVING SUM("t7"."cr_return_amt_inc_tax") IS NOT NULL) AS "t16" +INNER JOIN (SELECT CAST(SUM("t26"."$f2") / COUNT("t26"."$f2") AS DECIMAL(19, 6)) * 1.2 AS "_o__c0", "t26"."ca_state" AS "ctr_state" +FROM (SELECT "t19"."cr_returning_customer_sk", "t25"."ca_state", SUM("t19"."cr_return_amt_inc_tax") AS "$f2" +FROM (SELECT "cr_returned_date_sk", "cr_returning_customer_sk", "cr_returning_addr_sk", "cr_return_amt_inc_tax" +FROM (SELECT "cr_returned_date_sk", "cr_returning_customer_sk", "cr_returning_addr_sk", "cr_return_amt_inc_tax" +FROM "catalog_returns") AS "t17" +WHERE "cr_returned_date_sk" IS NOT NULL AND "cr_returning_addr_sk" IS NOT NULL) AS "t19" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t20" +WHERE "d_year" = 1998 AND "d_date_sk" IS NOT NULL) AS "t22" ON "t19"."cr_returned_date_sk" = "t22"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_state" +FROM (SELECT "ca_address_sk", "ca_state" +FROM "customer_address") AS "t23" +WHERE "ca_address_sk" IS NOT NULL AND "ca_state" IS NOT NULL) AS "t25" ON "t19"."cr_returning_addr_sk" = "t25"."ca_address_sk" +GROUP BY "t19"."cr_returning_customer_sk", "t25"."ca_state") AS "t26" +GROUP BY "t26"."ca_state" +HAVING CAST(SUM("t26"."$f2") / COUNT("t26"."$f2") AS DECIMAL(19, 6)) IS NOT NULL) AS "t29" ON "t16"."ca_state" = "t29"."ctr_state" AND "t16"."$f2" > "t29"."_o__c0") AS "t30" ON "t4"."c_customer_sk" = "t30"."cr_returning_customer_sk" +ORDER BY "t4"."c_customer_id", "t4"."c_salutation", "t4"."c_first_name", "t4"."c_last_name", "t1"."ca_street_number", "t1"."ca_street_name", "t1"."ca_street_type", "t1"."ca_suite_number", "t1"."ca_city", "t1"."ca_county", "t1"."ca_zip", "t1"."ca_country", "t1"."ca_gmt_offset", "t1"."ca_location_type", "t30"."$f2" +FETCH NEXT 100 ROWS ONLY) AS "t32" + hive.sql.query.fieldNames c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,ctr_total_return + hive.sql.query.fieldTypes string,string,string,string,string,string,string,string,string,string,string,string,string,decimal(5,2),string,decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: c_customer_id (type: string), c_salutation (type: string), c_first_name (type: string), c_last_name (type: string), ca_street_number (type: string), ca_street_name (type: string), ca_street_type (type: string), ca_suite_number (type: string), ca_city (type: string), ca_county (type: string), ca_state (type: string), ca_zip (type: string), ca_country (type: string), ca_gmt_offset (type: decimal(5,2)), ca_location_type (type: string), ctr_total_return (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query82.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query82.q.out new file mode 100644 index 000000000000..5ae7411210c8 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query82.q.out @@ -0,0 +1,41 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: item + properties: + hive.sql.query SELECT "t13"."i_item_id", "t13"."i_item_desc", "t13"."i_current_price" +FROM (SELECT "t1"."i_item_id", "t1"."i_item_desc", "t1"."i_current_price" +FROM (SELECT "i_item_sk", "i_item_id", "i_item_desc", "i_current_price" +FROM (SELECT "i_item_sk", "i_item_id", "i_item_desc", "i_current_price", "i_manufact_id" +FROM "item") AS "t" +WHERE "i_manufact_id" IN (129, 437, 663, 727) AND "i_current_price" BETWEEN 30 AND 60 AND "i_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ss_item_sk" +FROM (SELECT "ss_item_sk" +FROM "store_sales") AS "t2" +WHERE "ss_item_sk" IS NOT NULL) AS "t4" ON "t1"."i_item_sk" = "t4"."ss_item_sk" +INNER JOIN (SELECT "t7"."inv_date_sk", "t7"."inv_item_sk", "t10"."d_date_sk" +FROM (SELECT "inv_date_sk", "inv_item_sk" +FROM (SELECT "inv_date_sk", "inv_item_sk", "inv_quantity_on_hand" +FROM "inventory") AS "t5" +WHERE "inv_quantity_on_hand" BETWEEN 100 AND 500 AND "inv_item_sk" IS NOT NULL AND "inv_date_sk" IS NOT NULL) AS "t7" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t8" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '2002-05-30 00:00:00.000000000' AND TIMESTAMP '2002-07-29 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t10" ON "t7"."inv_date_sk" = "t10"."d_date_sk") AS "t11" ON "t1"."i_item_sk" = "t11"."inv_item_sk" +GROUP BY "t1"."i_item_id", "t1"."i_item_desc", "t1"."i_current_price" +ORDER BY "t1"."i_item_id" +FETCH NEXT 100 ROWS ONLY) AS "t13" + hive.sql.query.fieldNames i_item_id,i_item_desc,i_current_price + hive.sql.query.fieldTypes string,string,decimal(7,2) + hive.sql.query.split false + Select Operator + expressions: i_item_id (type: string), i_item_desc (type: string), i_current_price (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query83.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query83.q.out new file mode 100644 index 000000000000..00bb21d66556 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query83.q.out @@ -0,0 +1,422 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 10 <- Reducer 9 (SIMPLE_EDGE) + Reducer 11 <- Map 15 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE) + Reducer 12 <- Reducer 11 (SIMPLE_EDGE) + Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 10 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 12 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) + Reducer 8 <- Map 13 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 9 <- Map 14 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_returns + properties: + hive.sql.query SELECT "t1"."sr_returned_date_sk", "t1"."sr_item_sk", "t1"."sr_return_quantity", "t4"."i_item_sk", "t4"."i_item_id", "t7"."d_date_sk", "t7"."d_date" +FROM (SELECT "sr_returned_date_sk", "sr_item_sk", "sr_return_quantity" +FROM (SELECT "sr_returned_date_sk", "sr_item_sk", "sr_return_quantity" +FROM "store_returns") AS "t" +WHERE "sr_item_sk" IS NOT NULL AND "sr_returned_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t2" +WHERE "i_item_sk" IS NOT NULL AND "i_item_id" IS NOT NULL) AS "t4" ON "t1"."sr_item_sk" = "t4"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t5" +WHERE "d_date" IS NOT NULL AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."sr_returned_date_sk" = "t7"."d_date_sk" + hive.sql.query.fieldNames sr_returned_date_sk,sr_item_sk,sr_return_quantity,i_item_sk,i_item_id,d_date_sk,d_date + hive.sql.query.fieldTypes int,bigint,int,bigint,string,int,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: sr_return_quantity (type: int), i_item_id (type: string), d_date (type: string) + outputColumnNames: _col2, _col4, _col6 + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col6 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col6 (type: string) + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: int), _col4 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 13 + Map Operator Tree: + TableScan + alias: date_dim + properties: + hive.sql.query SELECT "d_week_seq" +FROM (SELECT "d_date", "d_week_seq" +FROM "date_dim") AS "t" +WHERE "d_date" IN ('1998-01-02', '1998-10-15', '1998-11-10') AND "d_week_seq" IS NOT NULL + hive.sql.query.fieldNames d_week_seq + hive.sql.query.fieldTypes int + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: d_week_seq (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 14 + Map Operator Tree: + TableScan + alias: catalog_returns + properties: + hive.sql.query SELECT "t1"."cr_returned_date_sk", "t1"."cr_item_sk", "t1"."cr_return_quantity", "t4"."i_item_sk", "t4"."i_item_id", "t7"."d_date_sk", "t7"."d_date" +FROM (SELECT "cr_returned_date_sk", "cr_item_sk", "cr_return_quantity" +FROM (SELECT "cr_returned_date_sk", "cr_item_sk", "cr_return_quantity" +FROM "catalog_returns") AS "t" +WHERE "cr_item_sk" IS NOT NULL AND "cr_returned_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t2" +WHERE "i_item_sk" IS NOT NULL AND "i_item_id" IS NOT NULL) AS "t4" ON "t1"."cr_item_sk" = "t4"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t5" +WHERE "d_date" IS NOT NULL AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."cr_returned_date_sk" = "t7"."d_date_sk" + hive.sql.query.fieldNames cr_returned_date_sk,cr_item_sk,cr_return_quantity,i_item_sk,i_item_id,d_date_sk,d_date + hive.sql.query.fieldTypes int,bigint,int,bigint,string,int,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cr_return_quantity (type: int), i_item_id (type: string), d_date (type: string) + outputColumnNames: _col2, _col4, _col6 + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col6 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col6 (type: string) + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: int), _col4 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 15 + Map Operator Tree: + TableScan + alias: web_returns + properties: + hive.sql.query SELECT "t1"."wr_returned_date_sk", "t1"."wr_item_sk", "t1"."wr_return_quantity", "t4"."i_item_sk", "t4"."i_item_id", "t7"."d_date_sk", "t7"."d_date" +FROM (SELECT "wr_returned_date_sk", "wr_item_sk", "wr_return_quantity" +FROM (SELECT "wr_returned_date_sk", "wr_item_sk", "wr_return_quantity" +FROM "web_returns") AS "t" +WHERE "wr_item_sk" IS NOT NULL AND "wr_returned_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "i_item_sk", "i_item_id" +FROM (SELECT "i_item_sk", "i_item_id" +FROM "item") AS "t2" +WHERE "i_item_sk" IS NOT NULL AND "i_item_id" IS NOT NULL) AS "t4" ON "t1"."wr_item_sk" = "t4"."i_item_sk" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t5" +WHERE "d_date" IS NOT NULL AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."wr_returned_date_sk" = "t7"."d_date_sk" + hive.sql.query.fieldNames wr_returned_date_sk,wr_item_sk,wr_return_quantity,i_item_sk,i_item_id,d_date_sk,d_date + hive.sql.query.fieldTypes int,bigint,int,bigint,string,int,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: wr_return_quantity (type: int), i_item_id (type: string), d_date (type: string) + outputColumnNames: _col2, _col4, _col6 + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col6 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col6 (type: string) + Statistics: Num rows: 1 Data size: 372 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: int), _col4 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: date_dim + properties: + hive.sql.query SELECT "d_date", "d_week_seq" +FROM (SELECT "d_date", "d_week_seq" +FROM "date_dim") AS "t" +WHERE "d_week_seq" IS NOT NULL AND "d_date" IS NOT NULL + hive.sql.query.fieldNames d_date,d_week_seq + hive.sql.query.fieldTypes string,int + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: d_date (type: string), d_week_seq (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 10 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: bigint), UDFToDouble(_col1) (type: double) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint), _col2 (type: double) + Reducer 11 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col6 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col2, _col4 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col2) + keys: _col4 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint) + Reducer 12 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: bigint), UDFToDouble(_col1) (type: double) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint), _col2 (type: double) + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col6 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col2, _col4 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col2) + keys: _col4 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: bigint), UDFToDouble(_col1) (type: double) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint), _col2 (type: double) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col0, _col1, _col2, _col4, _col5 + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 449 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint), _col2 (type: double), _col4 (type: bigint), _col5 (type: double) + Reducer 5 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col7, _col8 + Statistics: Num rows: 1 Data size: 493 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: _col0 (type: string), _col1 (type: bigint) + null sort order: zz + Statistics: Num rows: 1 Data size: 493 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col0 (type: string), _col1 (type: bigint), (((_col2 / UDFToDouble(((_col1 + _col4) + _col7))) / 3.0D) * 100.0D) (type: double), _col4 (type: bigint), (((_col5 / UDFToDouble(((_col1 + _col4) + _col7))) / 3.0D) * 100.0D) (type: double), _col7 (type: bigint), (((_col8 / UDFToDouble(((_col1 + _col4) + _col7))) / 3.0D) * 100.0D) (type: double), (CAST( ((_col1 + _col4) + _col7) AS decimal(19,0)) / 3) (type: decimal(25,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 493 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: bigint) + null sort order: zz + sort order: ++ + Statistics: Num rows: 1 Data size: 493 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: double), _col3 (type: bigint), _col4 (type: double), _col5 (type: bigint), _col6 (type: double), _col7 (type: decimal(25,6)) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: bigint), VALUE._col0 (type: double), VALUE._col1 (type: bigint), VALUE._col2 (type: double), VALUE._col3 (type: bigint), VALUE._col4 (type: double), VALUE._col5 (type: decimal(25,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 493 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 493 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 493 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 8 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col1 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 206 Basic stats: COMPLETE Column stats: NONE + Reducer 9 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col6 (type: string) + 1 _col0 (type: string) + outputColumnNames: _col2, _col4 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col2) + keys: _col4 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: string) + Statistics: Num rows: 1 Data size: 409 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: bigint) + + Stage: Stage-0 + Fetch Operator + limit: 100 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query84.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query84.q.out new file mode 100644 index 000000000000..7b7463d17413 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query84.q.out @@ -0,0 +1,212 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE) + Reducer 3 <- Map 7 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Map 8 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "c_customer_id", "c_current_cdemo_sk", "c_current_hdemo_sk", "c_current_addr_sk", "c_first_name", "c_last_name" +FROM (SELECT "c_customer_id", "c_current_cdemo_sk", "c_current_hdemo_sk", "c_current_addr_sk", "c_first_name", "c_last_name" +FROM "customer") AS "t" +WHERE "c_current_addr_sk" IS NOT NULL AND "c_current_cdemo_sk" IS NOT NULL AND "c_current_hdemo_sk" IS NOT NULL + hive.sql.query.fieldNames c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_name,c_last_name + hive.sql.query.fieldTypes string,int,int,int,string,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 564 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: c_customer_id (type: string), c_current_cdemo_sk (type: int), c_current_hdemo_sk (type: int), c_current_addr_sk (type: int), concat(concat(c_last_name, ', '), c_first_name) (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 564 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col3 (type: int) + Statistics: Num rows: 1 Data size: 564 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col1 (type: int), _col2 (type: int), _col4 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: customer_address + properties: + hive.sql.query SELECT "ca_address_sk" +FROM (SELECT "ca_address_sk", "ca_city" +FROM "customer_address") AS "t" +WHERE "ca_city" = 'Hopewell' AND "ca_address_sk" IS NOT NULL + hive.sql.query.fieldNames ca_address_sk + hive.sql.query.fieldTypes int + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ca_address_sk (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: customer_demographics + properties: + hive.sql.query SELECT "t1"."cd_demo_sk", "t4"."sr_cdemo_sk" +FROM (SELECT "cd_demo_sk" +FROM (SELECT "cd_demo_sk" +FROM "customer_demographics") AS "t" +WHERE "cd_demo_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "sr_cdemo_sk" +FROM (SELECT "sr_cdemo_sk" +FROM "store_returns") AS "t2" +WHERE "sr_cdemo_sk" IS NOT NULL) AS "t4" ON "t1"."cd_demo_sk" = "t4"."sr_cdemo_sk" + hive.sql.query.fieldNames cd_demo_sk,sr_cdemo_sk + hive.sql.query.fieldTypes int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cd_demo_sk (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 8 + Map Operator Tree: + TableScan + alias: household_demographics + properties: + hive.sql.query SELECT "t1"."hd_demo_sk", "t1"."hd_income_band_sk", "t3"."ib_income_band_sk" +FROM (SELECT "hd_demo_sk", "hd_income_band_sk" +FROM (SELECT "hd_demo_sk", "hd_income_band_sk" +FROM "household_demographics") AS "t" +WHERE "hd_demo_sk" IS NOT NULL AND "hd_income_band_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ib_income_band_sk" +FROM "income_band" +WHERE "ib_lower_bound" >= 32287 AND "ib_upper_bound" <= 82287 AND "ib_income_band_sk" IS NOT NULL) AS "t3" ON "t1"."hd_income_band_sk" = "t3"."ib_income_band_sk" + hive.sql.query.fieldNames hd_demo_sk,hd_income_band_sk,ib_income_band_sk + hive.sql.query.fieldTypes int,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: hd_demo_sk (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col3 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col0, _col1, _col2, _col4 + Statistics: Num rows: 1 Data size: 620 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 620 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col2 (type: int), _col4 (type: string) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col1 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col0, _col2, _col4 + Statistics: Num rows: 1 Data size: 682 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col2 (type: int) + Statistics: Num rows: 1 Data size: 682 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col4 (type: string) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col2 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col0, _col4 + Statistics: Num rows: 1 Data size: 750 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: + + keys: _col0 (type: string) + null sort order: z + Statistics: Num rows: 1 Data size: 750 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col4 (type: string), _col0 (type: string) + outputColumnNames: _col1, _col2 + Statistics: Num rows: 1 Data size: 750 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: string) + null sort order: z + sort order: + + Statistics: Num rows: 1 Data size: 750 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 750 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 750 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 750 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query85.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query85.q.out new file mode 100644 index 000000000000..0472e443bd79 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query85.q.out @@ -0,0 +1,97 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: web_returns + properties: + hive.sql.query SELECT "t4"."r_reason_desc", SUM("t23"."ws_quantity") AS "$f1", COUNT("t23"."ws_quantity") AS "$f2", SUM("t1"."wr_refunded_cash") AS "$f3", COUNT("t1"."wr_refunded_cash") AS "$f4", SUM("t1"."wr_fee") AS "$f5", COUNT("t1"."wr_fee") AS "$f6" +FROM (SELECT "wr_item_sk", "wr_refunded_cdemo_sk", "wr_refunded_addr_sk", "wr_returning_cdemo_sk", "wr_reason_sk", "wr_order_number", "wr_fee", "wr_refunded_cash" +FROM (SELECT "wr_item_sk", "wr_refunded_cdemo_sk", "wr_refunded_addr_sk", "wr_returning_cdemo_sk", "wr_reason_sk", "wr_order_number", "wr_fee", "wr_refunded_cash" +FROM "web_returns") AS "t" +WHERE "wr_item_sk" IS NOT NULL AND ("wr_order_number" IS NOT NULL AND "wr_refunded_cdemo_sk" IS NOT NULL) AND ("wr_returning_cdemo_sk" IS NOT NULL AND ("wr_refunded_addr_sk" IS NOT NULL AND "wr_reason_sk" IS NOT NULL))) AS "t1" +INNER JOIN (SELECT "r_reason_sk", "r_reason_desc" +FROM (SELECT "r_reason_sk", "r_reason_desc" +FROM "reason") AS "t2" +WHERE "r_reason_sk" IS NOT NULL) AS "t4" ON "t1"."wr_reason_sk" = "t4"."r_reason_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_state" IN ('GA', 'KY', 'NM') AS "EXPR$0", "ca_state" IN ('IN', 'MT', 'OR') AS "EXPR$1", "ca_state" IN ('MO', 'WI', 'WV') AS "EXPR$2" +FROM (SELECT "ca_address_sk", "ca_state", "ca_country" +FROM "customer_address") AS "t5" +WHERE "ca_state" IN ('GA', 'IN', 'KY', 'MO', 'MT', 'NM', 'OR', 'WI', 'WV') AND "ca_country" = 'United States' AND "ca_address_sk" IS NOT NULL) AS "t7" ON "t1"."wr_refunded_addr_sk" = "t7"."ca_address_sk" +INNER JOIN (SELECT "cd_demo_sk", "cd_marital_status", "cd_education_status", "cd_marital_status" = 'M' AS "EXPR$0", "cd_education_status" = '4 yr Degree' AS "EXPR$1", "cd_marital_status" = 'D' AS "EXPR$2", "cd_education_status" = 'Primary' AS "EXPR$3", "cd_marital_status" = 'U' AS "EXPR$4", "cd_education_status" = 'Advanced Degree' AS "EXPR$5" +FROM (SELECT "cd_demo_sk", "cd_marital_status", "cd_education_status" +FROM "customer_demographics") AS "t8" +WHERE "cd_marital_status" IN ('D', 'M', 'U') AND "cd_education_status" IN ('4 yr Degree', 'Advanced Degree', 'Primary') AND "cd_demo_sk" IS NOT NULL) AS "t10" ON "t1"."wr_refunded_cdemo_sk" = "t10"."cd_demo_sk" +INNER JOIN (SELECT "cd_demo_sk", "cd_marital_status", "cd_education_status" +FROM (SELECT "cd_demo_sk", "cd_marital_status", "cd_education_status" +FROM "customer_demographics") AS "t11" +WHERE "cd_marital_status" IN ('D', 'M', 'U') AND "cd_education_status" IN ('4 yr Degree', 'Advanced Degree', 'Primary') AND "cd_demo_sk" IS NOT NULL) AS "t13" ON "t1"."wr_returning_cdemo_sk" = "t13"."cd_demo_sk" AND "t10"."cd_marital_status" = "t13"."cd_marital_status" AND "t10"."cd_education_status" = "t13"."cd_education_status" +INNER JOIN (SELECT "t16"."ws_sold_date_sk", "t16"."ws_item_sk", "t16"."ws_web_page_sk", "t16"."ws_order_number", "t16"."ws_quantity", "t16"."EXPR$0", "t16"."EXPR$1", "t16"."EXPR$2", "t16"."EXPR$3", "t16"."EXPR$4", "t16"."EXPR$5", "t19"."wp_web_page_sk", "t22"."d_date_sk" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_web_page_sk", "ws_order_number", "ws_quantity", "ws_net_profit" BETWEEN 100 AND 200 AS "EXPR$0", "ws_net_profit" BETWEEN 150 AND 300 AS "EXPR$1", "ws_net_profit" BETWEEN 50 AND 250 AS "EXPR$2", "ws_sales_price" BETWEEN 100 AND 150 AS "EXPR$3", "ws_sales_price" BETWEEN 50 AND 100 AS "EXPR$4", "ws_sales_price" BETWEEN 150 AND 200 AS "EXPR$5" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_web_page_sk", "ws_order_number", "ws_quantity", "ws_sales_price", "ws_net_profit" +FROM "web_sales") AS "t14" +WHERE "ws_sales_price" IS NOT NULL AND ("ws_net_profit" IS NOT NULL AND "ws_item_sk" IS NOT NULL) AND ("ws_order_number" IS NOT NULL AND ("ws_web_page_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL))) AS "t16" +INNER JOIN (SELECT "wp_web_page_sk" +FROM (SELECT "wp_web_page_sk" +FROM "web_page") AS "t17" +WHERE "wp_web_page_sk" IS NOT NULL) AS "t19" ON "t16"."ws_web_page_sk" = "t19"."wp_web_page_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year" +FROM "date_dim") AS "t20" +WHERE "d_year" = 1998 AND "d_date_sk" IS NOT NULL) AS "t22" ON "t16"."ws_sold_date_sk" = "t22"."d_date_sk") AS "t23" ON "t1"."wr_item_sk" = "t23"."ws_item_sk" AND "t1"."wr_order_number" = "t23"."ws_order_number" AND ("t10"."EXPR$0" AND "t10"."EXPR$1" AND "t23"."EXPR$3" OR "t10"."EXPR$2" AND "t10"."EXPR$3" AND "t23"."EXPR$4" OR "t10"."EXPR$4" AND "t10"."EXPR$5" AND "t23"."EXPR$5") AND ("t7"."EXPR$0" AND "t23"."EXPR$0" OR "t7"."EXPR$1" AND "t23"."EXPR$1" OR "t7"."EXPR$2" AND "t23"."EXPR$2") +GROUP BY "t4"."r_reason_desc" + hive.sql.query.fieldNames r_reason_desc,$f1,$f2,$f3,$f4,$f5,$f6 + hive.sql.query.fieldTypes string,bigint,bigint,decimal(17,2),bigint,decimal(17,2),bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 440 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++++ + keys: substr(r_reason_desc, 1, 20) (type: string), (UDFToDouble($f1) / $f2) (type: double), CAST( ($f3 / $f4) AS decimal(11,6)) (type: decimal(11,6)), CAST( ($f5 / $f6) AS decimal(11,6)) (type: decimal(11,6)) + null sort order: zzzz + Statistics: Num rows: 1 Data size: 440 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: (UDFToDouble($f1) / $f2) (type: double), CAST( ($f3 / $f4) AS decimal(11,6)) (type: decimal(11,6)), CAST( ($f5 / $f6) AS decimal(11,6)) (type: decimal(11,6)), substr(r_reason_desc, 1, 20) (type: string) + outputColumnNames: _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 440 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col7 (type: string), _col4 (type: double), _col5 (type: decimal(11,6)), _col6 (type: decimal(11,6)) + null sort order: zzzz + sort order: ++++ + Statistics: Num rows: 1 Data size: 440 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: double), KEY.reducesinkkey2 (type: decimal(11,6)), KEY.reducesinkkey3 (type: decimal(11,6)) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 440 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 440 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 440 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query86.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query86.q.out new file mode 100644 index 000000000000..45f488233533 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query86.q.out @@ -0,0 +1,145 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT "t7"."i_category" AS "$f0", "t7"."i_class" AS "$f1", "t1"."ws_net_paid" AS "$f2" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_net_paid" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_net_paid" +FROM "web_sales") AS "t" +WHERE "ws_sold_date_sk" IS NOT NULL AND "ws_item_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM "date_dim") AS "t2" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "i_item_sk", "i_class", "i_category" +FROM (SELECT "i_item_sk", "i_class", "i_category" +FROM "item") AS "t5" +WHERE "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ws_item_sk" = "t7"."i_item_sk" + hive.sql.query.fieldNames $f0,$f1,$f2 + hive.sql.query.fieldTypes string,string,decimal(7,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: string), $f1 (type: string), $f2 (type: decimal(7,2)) + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col2) + keys: _col0 (type: string), _col1 (type: string), 0L (type: bigint) + grouping sets: 0, 1, 3 + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 3 Data size: 1440 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: bigint) + Statistics: Num rows: 3 Data size: 1440 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: bigint) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: string), _col3 (type: decimal(17,2)), _col2 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: (grouping(_col3, 1L) + grouping(_col3, 0L)) (type: bigint), CASE WHEN ((grouping(_col3, 0L) = UDFToLong(0))) THEN (_col0) ELSE (CAST( null AS STRING)) END (type: string), _col2 (type: decimal(17,2)) + null sort order: aaa + sort order: ++- + Map-reduce partition columns: (grouping(_col3, 1L) + grouping(_col3, 0L)) (type: bigint), CASE WHEN ((grouping(_col3, 0L) = UDFToLong(0))) THEN (_col0) ELSE (CAST( null AS STRING)) END (type: string) + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col1 (type: string), _col3 (type: bigint) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: string), VALUE._col1 (type: string), KEY.reducesinkkey2 (type: decimal(17,2)), VALUE._col2 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: string, _col2: decimal(17,2), _col3: bigint + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col2 DESC NULLS FIRST + partition by: (grouping(_col3, 1L) + grouping(_col3, 0L)), CASE WHEN ((grouping(_col3, 0L) = UDFToLong(0))) THEN (_col0) ELSE (CAST( null AS STRING)) END + raw input shape: + window functions: + window function definition + alias: rank_window_0 + arguments: _col2 + name: rank + window function: GenericUDAFRankEvaluator + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + isPivotResult: true + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: -++ + keys: (grouping(_col3, 1L) + grouping(_col3, 0L)) (type: bigint), if(((grouping(_col3, 1L) + grouping(_col3, 0L)) = 0L), _col0, null) (type: string), rank_window_0 (type: int) + null sort order: azz + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col2 (type: decimal(17,2)), _col0 (type: string), _col1 (type: string), (grouping(_col3, 1L) + grouping(_col3, 0L)) (type: bigint), rank_window_0 (type: int), if(((grouping(_col3, 1L) + grouping(_col3, 0L)) = 0L), _col0, null) (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: bigint), _col5 (type: string), _col4 (type: int) + null sort order: azz + sort order: -++ + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(17,2)), _col1 (type: string), _col2 (type: string) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: decimal(17,2)), VALUE._col1 (type: string), VALUE._col2 (type: string), KEY.reducesinkkey0 (type: bigint), KEY.reducesinkkey2 (type: int) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 480 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query87.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query87.q.out new file mode 100644 index 000000000000..e515802bd2ad --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query87.q.out @@ -0,0 +1,78 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) AS "$f0" +FROM (SELECT "$f0", "$f1", "$f2", SUM("$f4") AS "$f3", SUM("$f3" * "$f4") AS "$f4" +FROM (SELECT "$f0", "$f1", "$f2", 2 AS "$f3", COUNT(*) AS "$f4" +FROM (SELECT "$f0", "$f1", "$f2", SUM("$f4") AS "$f3", SUM("$f3" * "$f4") AS "$f4" +FROM (SELECT "t8"."c_last_name" AS "$f0", "t8"."c_first_name" AS "$f1", "t8"."d_date" AS "$f2", 2 AS "$f3", COUNT(*) AS "$f4" +FROM (SELECT "t4"."d_date", "t7"."c_first_name", "t7"."c_last_name" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk" +FROM (SELECT "ss_sold_date_sk", "ss_customer_sk" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL AND "ss_customer_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date", "d_month_seq" +FROM "date_dim") AS "t2" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "c_customer_sk", "c_first_name", "c_last_name" +FROM (SELECT "c_customer_sk", "c_first_name", "c_last_name" +FROM "customer") AS "t5" +WHERE "c_customer_sk" IS NOT NULL) AS "t7" ON "t1"."ss_customer_sk" = "t7"."c_customer_sk" +GROUP BY "t4"."d_date", "t7"."c_first_name", "t7"."c_last_name") AS "t8" +GROUP BY "t8"."d_date", "t8"."c_first_name", "t8"."c_last_name" +UNION ALL +SELECT "t20"."c_last_name" AS "$f0", "t20"."c_first_name" AS "$f1", "t20"."d_date" AS "$f2", 1 AS "$f3", COUNT(*) AS "$f4" +FROM (SELECT "t16"."d_date", "t19"."c_first_name", "t19"."c_last_name" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk" +FROM "catalog_sales") AS "t11" +WHERE "cs_sold_date_sk" IS NOT NULL AND "cs_bill_customer_sk" IS NOT NULL) AS "t13" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date", "d_month_seq" +FROM "date_dim") AS "t14" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t16" ON "t13"."cs_sold_date_sk" = "t16"."d_date_sk" +INNER JOIN (SELECT "c_customer_sk", "c_first_name", "c_last_name" +FROM (SELECT "c_customer_sk", "c_first_name", "c_last_name" +FROM "customer") AS "t17" +WHERE "c_customer_sk" IS NOT NULL) AS "t19" ON "t13"."cs_bill_customer_sk" = "t19"."c_customer_sk" +GROUP BY "t16"."d_date", "t19"."c_first_name", "t19"."c_last_name") AS "t20" +GROUP BY "t20"."d_date", "t20"."c_first_name", "t20"."c_last_name") AS "t23" +GROUP BY "$f0", "$f1", "$f2" +HAVING SUM("$f4") > 0 AND SUM("$f4") * 2 = SUM("$f3" * "$f4")) AS "t27" +GROUP BY "$f0", "$f1", "$f2" +UNION ALL +SELECT "t39"."c_last_name" AS "$f0", "t39"."c_first_name" AS "$f1", "t39"."d_date" AS "$f2", 1 AS "$f3", COUNT(*) AS "$f4" +FROM (SELECT "t35"."d_date", "t38"."c_first_name", "t38"."c_last_name" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk" +FROM (SELECT "ws_sold_date_sk", "ws_bill_customer_sk" +FROM "web_sales") AS "t30" +WHERE "ws_sold_date_sk" IS NOT NULL AND "ws_bill_customer_sk" IS NOT NULL) AS "t32" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date", "d_month_seq" +FROM "date_dim") AS "t33" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t35" ON "t32"."ws_sold_date_sk" = "t35"."d_date_sk" +INNER JOIN (SELECT "c_customer_sk", "c_first_name", "c_last_name" +FROM (SELECT "c_customer_sk", "c_first_name", "c_last_name" +FROM "customer") AS "t36" +WHERE "c_customer_sk" IS NOT NULL) AS "t38" ON "t32"."ws_bill_customer_sk" = "t38"."c_customer_sk" +GROUP BY "t35"."d_date", "t38"."c_first_name", "t38"."c_last_name") AS "t39" +GROUP BY "t39"."d_date", "t39"."c_first_name", "t39"."c_last_name") AS "t42" +GROUP BY "$f0", "$f1", "$f2" +HAVING SUM("$f4") > 0 AND SUM("$f4") * 2 = SUM("$f3" * "$f4")) AS "t46" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Select Operator + expressions: $f0 (type: bigint) + outputColumnNames: _col0 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query88.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query88.q.out new file mode 100644 index 000000000000..52c3628c4b8c --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query88.q.out @@ -0,0 +1,446 @@ +Warning: Shuffle Join MERGEJOIN[39][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product +Warning: Shuffle Join MERGEJOIN[40][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Reducer 3' is a cross product +Warning: Shuffle Join MERGEJOIN[41][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3]] in Stage 'Reducer 4' is a cross product +Warning: Shuffle Join MERGEJOIN[42][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4]] in Stage 'Reducer 5' is a cross product +Warning: Shuffle Join MERGEJOIN[43][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5]] in Stage 'Reducer 6' is a cross product +Warning: Shuffle Join MERGEJOIN[44][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6]] in Stage 'Reducer 7' is a cross product +Warning: Shuffle Join MERGEJOIN[45][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7]] in Stage 'Reducer 8' is a cross product +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (XPROD_EDGE), Map 9 (XPROD_EDGE) + Reducer 3 <- Map 10 (XPROD_EDGE), Reducer 2 (XPROD_EDGE) + Reducer 4 <- Map 11 (XPROD_EDGE), Reducer 3 (XPROD_EDGE) + Reducer 5 <- Map 12 (XPROD_EDGE), Reducer 4 (XPROD_EDGE) + Reducer 6 <- Map 13 (XPROD_EDGE), Reducer 5 (XPROD_EDGE) + Reducer 7 <- Map 14 (XPROD_EDGE), Reducer 6 (XPROD_EDGE) + Reducer 8 <- Map 15 (XPROD_EDGE), Reducer 7 (XPROD_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) AS "$f0" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM "store_sales") AS "t" +WHERE "ss_hdemo_sk" IS NOT NULL AND "ss_sold_time_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t2" +WHERE "hd_vehicle_count" <= 5 AND ("hd_dep_count" = 3 AND "hd_vehicle_count" IS NOT NULL OR "hd_dep_count" = 0 AND "hd_vehicle_count" <= 2 OR "hd_dep_count" = 1 AND "hd_vehicle_count" <= 3) AND "hd_dep_count" IN (0, 1, 3) AND "hd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ss_hdemo_sk" = "t4"."hd_demo_sk" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_hour", "t_minute" +FROM "time_dim") AS "t5" +WHERE "t_minute" >= 30 AND "t_hour" = 8 AND "t_time_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_time_sk" = "t7"."t_time_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_store_name" +FROM "store") AS "t8" +WHERE "s_store_name" = 'ese' AND "s_store_sk" IS NOT NULL) AS "t10" ON "t1"."ss_store_sk" = "t10"."s_store_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 10 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) AS "$f0" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM "store_sales") AS "t" +WHERE "ss_hdemo_sk" IS NOT NULL AND "ss_sold_time_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t2" +WHERE "hd_vehicle_count" <= 5 AND ("hd_dep_count" = 3 AND "hd_vehicle_count" IS NOT NULL OR "hd_dep_count" = 0 AND "hd_vehicle_count" <= 2 OR "hd_dep_count" = 1 AND "hd_vehicle_count" <= 3) AND "hd_dep_count" IN (0, 1, 3) AND "hd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ss_hdemo_sk" = "t4"."hd_demo_sk" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_hour", "t_minute" +FROM "time_dim") AS "t5" +WHERE "t_minute" >= 30 AND "t_hour" = 11 AND "t_time_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_time_sk" = "t7"."t_time_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_store_name" +FROM "store") AS "t8" +WHERE "s_store_name" = 'ese' AND "s_store_sk" IS NOT NULL) AS "t10" ON "t1"."ss_store_sk" = "t10"."s_store_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 11 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) AS "$f0" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM "store_sales") AS "t" +WHERE "ss_hdemo_sk" IS NOT NULL AND "ss_sold_time_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t2" +WHERE "hd_vehicle_count" <= 5 AND ("hd_dep_count" = 3 AND "hd_vehicle_count" IS NOT NULL OR "hd_dep_count" = 0 AND "hd_vehicle_count" <= 2 OR "hd_dep_count" = 1 AND "hd_vehicle_count" <= 3) AND "hd_dep_count" IN (0, 1, 3) AND "hd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ss_hdemo_sk" = "t4"."hd_demo_sk" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_hour", "t_minute" +FROM "time_dim") AS "t5" +WHERE "t_minute" < 30 AND "t_hour" = 11 AND "t_time_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_time_sk" = "t7"."t_time_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_store_name" +FROM "store") AS "t8" +WHERE "s_store_name" = 'ese' AND "s_store_sk" IS NOT NULL) AS "t10" ON "t1"."ss_store_sk" = "t10"."s_store_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 12 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) AS "$f0" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM "store_sales") AS "t" +WHERE "ss_hdemo_sk" IS NOT NULL AND "ss_sold_time_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t2" +WHERE "hd_vehicle_count" <= 5 AND ("hd_dep_count" = 3 AND "hd_vehicle_count" IS NOT NULL OR "hd_dep_count" = 0 AND "hd_vehicle_count" <= 2 OR "hd_dep_count" = 1 AND "hd_vehicle_count" <= 3) AND "hd_dep_count" IN (0, 1, 3) AND "hd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ss_hdemo_sk" = "t4"."hd_demo_sk" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_hour", "t_minute" +FROM "time_dim") AS "t5" +WHERE "t_minute" >= 30 AND "t_hour" = 10 AND "t_time_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_time_sk" = "t7"."t_time_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_store_name" +FROM "store") AS "t8" +WHERE "s_store_name" = 'ese' AND "s_store_sk" IS NOT NULL) AS "t10" ON "t1"."ss_store_sk" = "t10"."s_store_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 13 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) AS "$f0" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM "store_sales") AS "t" +WHERE "ss_hdemo_sk" IS NOT NULL AND "ss_sold_time_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t2" +WHERE "hd_vehicle_count" <= 5 AND ("hd_dep_count" = 3 AND "hd_vehicle_count" IS NOT NULL OR "hd_dep_count" = 0 AND "hd_vehicle_count" <= 2 OR "hd_dep_count" = 1 AND "hd_vehicle_count" <= 3) AND "hd_dep_count" IN (0, 1, 3) AND "hd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ss_hdemo_sk" = "t4"."hd_demo_sk" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_hour", "t_minute" +FROM "time_dim") AS "t5" +WHERE "t_minute" < 30 AND "t_hour" = 10 AND "t_time_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_time_sk" = "t7"."t_time_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_store_name" +FROM "store") AS "t8" +WHERE "s_store_name" = 'ese' AND "s_store_sk" IS NOT NULL) AS "t10" ON "t1"."ss_store_sk" = "t10"."s_store_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 14 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) AS "$f0" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM "store_sales") AS "t" +WHERE "ss_hdemo_sk" IS NOT NULL AND "ss_sold_time_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t2" +WHERE "hd_vehicle_count" <= 5 AND ("hd_dep_count" = 3 AND "hd_vehicle_count" IS NOT NULL OR "hd_dep_count" = 0 AND "hd_vehicle_count" <= 2 OR "hd_dep_count" = 1 AND "hd_vehicle_count" <= 3) AND "hd_dep_count" IN (0, 1, 3) AND "hd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ss_hdemo_sk" = "t4"."hd_demo_sk" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_hour", "t_minute" +FROM "time_dim") AS "t5" +WHERE "t_minute" >= 30 AND "t_hour" = 9 AND "t_time_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_time_sk" = "t7"."t_time_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_store_name" +FROM "store") AS "t8" +WHERE "s_store_name" = 'ese' AND "s_store_sk" IS NOT NULL) AS "t10" ON "t1"."ss_store_sk" = "t10"."s_store_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 15 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) AS "$f0" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM "store_sales") AS "t" +WHERE "ss_hdemo_sk" IS NOT NULL AND "ss_sold_time_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t2" +WHERE "hd_vehicle_count" <= 5 AND ("hd_dep_count" = 3 AND "hd_vehicle_count" IS NOT NULL OR "hd_dep_count" = 0 AND "hd_vehicle_count" <= 2 OR "hd_dep_count" = 1 AND "hd_vehicle_count" <= 3) AND "hd_dep_count" IN (0, 1, 3) AND "hd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ss_hdemo_sk" = "t4"."hd_demo_sk" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_hour", "t_minute" +FROM "time_dim") AS "t5" +WHERE "t_minute" < 30 AND "t_hour" = 9 AND "t_time_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_time_sk" = "t7"."t_time_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_store_name" +FROM "store") AS "t8" +WHERE "s_store_name" = 'ese' AND "s_store_sk" IS NOT NULL) AS "t10" ON "t1"."ss_store_sk" = "t10"."s_store_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) AS "$f0" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM "store_sales") AS "t" +WHERE "ss_hdemo_sk" IS NOT NULL AND "ss_sold_time_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count", "hd_vehicle_count" +FROM "household_demographics") AS "t2" +WHERE "hd_vehicle_count" <= 5 AND ("hd_dep_count" = 3 AND "hd_vehicle_count" IS NOT NULL OR "hd_dep_count" = 0 AND "hd_vehicle_count" <= 2 OR "hd_dep_count" = 1 AND "hd_vehicle_count" <= 3) AND "hd_dep_count" IN (0, 1, 3) AND "hd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ss_hdemo_sk" = "t4"."hd_demo_sk" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_hour", "t_minute" +FROM "time_dim") AS "t5" +WHERE "t_minute" < 30 AND "t_hour" = 12 AND "t_time_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_time_sk" = "t7"."t_time_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_store_name" +FROM "store") AS "t8" +WHERE "s_store_name" = 'ese' AND "s_store_sk" IS NOT NULL) AS "t10" ON "t1"."ss_store_sk" = "t10"."s_store_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 17 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 17 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: bigint) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 26 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 26 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: bigint) + Reducer 5 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 44 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 44 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: bigint), _col4 (type: bigint) + Reducer 6 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 53 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 53 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: bigint), _col4 (type: bigint), _col5 (type: bigint) + Reducer 7 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 62 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 62 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: bigint), _col2 (type: bigint), _col3 (type: bigint), _col4 (type: bigint), _col5 (type: bigint), _col6 (type: bigint) + Reducer 8 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 71 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: bigint), _col7 (type: bigint), _col6 (type: bigint), _col5 (type: bigint), _col4 (type: bigint), _col3 (type: bigint), _col2 (type: bigint), _col1 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 71 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 71 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query89.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query89.q.out new file mode 100644 index 000000000000..9eb5950e5e9b --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query89.q.out @@ -0,0 +1,127 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t4"."d_moy", "t7"."s_store_name", "t7"."s_company_name", "t10"."i_brand", "t10"."i_class", "t10"."i_category", SUM("t1"."ss_sales_price") AS "$f6" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_store_sk", "ss_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_item_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_moy" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t2" +WHERE "d_year" = 2000 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "s_store_sk", "s_store_name", "s_company_name" +FROM (SELECT "s_store_sk", "s_store_name", "s_company_name" +FROM "store") AS "t5" +WHERE "s_store_sk" IS NOT NULL) AS "t7" ON "t1"."ss_store_sk" = "t7"."s_store_sk" +INNER JOIN (SELECT "i_item_sk", "i_brand", "i_class", "i_category" +FROM (SELECT "i_item_sk", "i_brand", "i_class", "i_category" +FROM "item") AS "t8" +WHERE ("i_category" IN ('Books', 'Electronics', 'Home') AND "i_class" IN ('musical', 'parenting', 'wallpaper') OR "i_category" IN ('Jewelry', 'Men', 'Shoes') AND "i_class" IN ('birdal', 'pants', 'womens')) AND "i_class" IN ('birdal', 'musical', 'pants', 'parenting', 'wallpaper', 'womens') AND "i_category" IN ('Books', 'Electronics', 'Home', 'Jewelry', 'Men', 'Shoes') AND "i_item_sk" IS NOT NULL) AS "t10" ON "t1"."ss_item_sk" = "t10"."i_item_sk" +GROUP BY "t4"."d_moy", "t7"."s_store_name", "t7"."s_company_name", "t10"."i_brand", "t10"."i_class", "t10"."i_category" + hive.sql.query.fieldNames d_moy,s_store_name,s_company_name,i_brand,i_class,i_category,$f6 + hive.sql.query.fieldTypes int,string,string,string,string,string,decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: d_moy (type: int), s_store_name (type: string), s_company_name (type: string), i_brand (type: string), i_class (type: string), i_category (type: string), $f6 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col5 (type: string), _col3 (type: string), _col1 (type: string), _col2 (type: string) + null sort order: aaaa + sort order: ++++ + Map-reduce partition columns: _col5 (type: string), _col3 (type: string), _col1 (type: string), _col2 (type: string) + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: int), _col4 (type: string), _col6 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: int), KEY.reducesinkkey2 (type: string), KEY.reducesinkkey3 (type: string), KEY.reducesinkkey1 (type: string), VALUE._col1 (type: string), KEY.reducesinkkey0 (type: string), VALUE._col2 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: int, _col1: string, _col2: string, _col3: string, _col4: string, _col5: string, _col6: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col5 ASC NULLS FIRST, _col3 ASC NULLS FIRST, _col1 ASC NULLS FIRST, _col2 ASC NULLS FIRST + partition by: _col5, _col3, _col1, _col2 + raw input shape: + window functions: + window function definition + alias: avg_window_0 + arguments: _col6 + name: avg + window function: GenericUDAFAverageEvaluatorDecimal + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: avg_window_0 (type: decimal(21,6)), _col0 (type: int), _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: string), _col5 (type: string), _col6 (type: decimal(17,2)) + outputColumnNames: avg_window_0, _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: if((avg_window_0 <> 0), ((abs((_col6 - avg_window_0)) / avg_window_0) > 0.1), false) (type: boolean) + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: ++ + keys: (_col6 - avg_window_0) (type: decimal(22,6)), _col1 (type: string) + null sort order: zz + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Select Operator + expressions: _col5 (type: string), _col4 (type: string), _col3 (type: string), _col1 (type: string), _col2 (type: string), _col0 (type: int), _col6 (type: decimal(17,2)), avg_window_0 (type: decimal(21,6)), (_col6 - avg_window_0) (type: decimal(22,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col8 (type: decimal(22,6)), _col3 (type: string) + null sort order: zz + sort order: ++ + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col4 (type: string), _col5 (type: int), _col6 (type: decimal(17,2)), _col7 (type: decimal(21,6)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: string), VALUE._col1 (type: string), VALUE._col2 (type: string), KEY.reducesinkkey1 (type: string), VALUE._col3 (type: string), VALUE._col4 (type: int), VALUE._col5 (type: decimal(17,2)), VALUE._col6 (type: decimal(21,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 1036 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query9.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query9.q.out new file mode 100644 index 000000000000..7174178c67c4 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query9.q.out @@ -0,0 +1,675 @@ +Warning: Shuffle Join MERGEJOIN[79][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product +Warning: Shuffle Join MERGEJOIN[80][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Reducer 3' is a cross product +Warning: Shuffle Join MERGEJOIN[81][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3]] in Stage 'Reducer 4' is a cross product +Warning: Shuffle Join MERGEJOIN[82][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4]] in Stage 'Reducer 5' is a cross product +Warning: Shuffle Join MERGEJOIN[83][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5]] in Stage 'Reducer 6' is a cross product +Warning: Shuffle Join MERGEJOIN[84][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6]] in Stage 'Reducer 7' is a cross product +Warning: Shuffle Join MERGEJOIN[85][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7]] in Stage 'Reducer 8' is a cross product +Warning: Shuffle Join MERGEJOIN[86][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8]] in Stage 'Reducer 9' is a cross product +Warning: Shuffle Join MERGEJOIN[87][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9]] in Stage 'Reducer 10' is a cross product +Warning: Shuffle Join MERGEJOIN[88][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9, $hdt$_10]] in Stage 'Reducer 11' is a cross product +Warning: Shuffle Join MERGEJOIN[89][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9, $hdt$_10, $hdt$_11]] in Stage 'Reducer 12' is a cross product +Warning: Shuffle Join MERGEJOIN[90][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9, $hdt$_10, $hdt$_11, $hdt$_12]] in Stage 'Reducer 13' is a cross product +Warning: Shuffle Join MERGEJOIN[91][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9, $hdt$_10, $hdt$_11, $hdt$_12, $hdt$_13]] in Stage 'Reducer 14' is a cross product +Warning: Shuffle Join MERGEJOIN[92][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9, $hdt$_10, $hdt$_11, $hdt$_12, $hdt$_13, $hdt$_14]] in Stage 'Reducer 15' is a cross product +Warning: Shuffle Join MERGEJOIN[93][tables = [$hdt$_0, $hdt$_1, $hdt$_2, $hdt$_3, $hdt$_4, $hdt$_5, $hdt$_6, $hdt$_7, $hdt$_8, $hdt$_9, $hdt$_10, $hdt$_11, $hdt$_12, $hdt$_13, $hdt$_14, $hdt$_15]] in Stage 'Reducer 16' is a cross product +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 10 <- Map 25 (CUSTOM_SIMPLE_EDGE), Reducer 9 (CUSTOM_SIMPLE_EDGE) + Reducer 11 <- Map 26 (CUSTOM_SIMPLE_EDGE), Reducer 10 (CUSTOM_SIMPLE_EDGE) + Reducer 12 <- Map 27 (CUSTOM_SIMPLE_EDGE), Reducer 11 (CUSTOM_SIMPLE_EDGE) + Reducer 13 <- Map 28 (CUSTOM_SIMPLE_EDGE), Reducer 12 (CUSTOM_SIMPLE_EDGE) + Reducer 14 <- Map 29 (CUSTOM_SIMPLE_EDGE), Reducer 13 (CUSTOM_SIMPLE_EDGE) + Reducer 15 <- Map 30 (CUSTOM_SIMPLE_EDGE), Reducer 14 (CUSTOM_SIMPLE_EDGE) + Reducer 16 <- Map 31 (CUSTOM_SIMPLE_EDGE), Reducer 15 (CUSTOM_SIMPLE_EDGE) + Reducer 2 <- Map 1 (CUSTOM_SIMPLE_EDGE), Map 17 (CUSTOM_SIMPLE_EDGE) + Reducer 3 <- Map 18 (CUSTOM_SIMPLE_EDGE), Reducer 2 (CUSTOM_SIMPLE_EDGE) + Reducer 4 <- Map 19 (CUSTOM_SIMPLE_EDGE), Reducer 3 (CUSTOM_SIMPLE_EDGE) + Reducer 5 <- Map 20 (CUSTOM_SIMPLE_EDGE), Reducer 4 (CUSTOM_SIMPLE_EDGE) + Reducer 6 <- Map 21 (CUSTOM_SIMPLE_EDGE), Reducer 5 (CUSTOM_SIMPLE_EDGE) + Reducer 7 <- Map 22 (CUSTOM_SIMPLE_EDGE), Reducer 6 (CUSTOM_SIMPLE_EDGE) + Reducer 8 <- Map 23 (CUSTOM_SIMPLE_EDGE), Reducer 7 (CUSTOM_SIMPLE_EDGE) + Reducer 9 <- Map 24 (CUSTOM_SIMPLE_EDGE), Reducer 8 (CUSTOM_SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: reason + properties: + hive.sql.query SELECT "r_reason_sk" +FROM (SELECT "r_reason_sk" +FROM "reason") AS "t" +WHERE "r_reason_sk" = 1 + hive.sql.query.fieldNames r_reason_sk + hive.sql.query.fieldTypes int + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: COMPLETE + Select Operator + Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: COMPLETE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: COMPLETE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 17 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) > 409437 +FROM (SELECT "ss_quantity" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 1 AND 20 + hive.sql.query.fieldNames EXPR$0 + hive.sql.query.fieldTypes boolean + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: expr$0 (type: boolean) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 18 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_ext_list_price") / COUNT("ss_ext_list_price") AS DECIMAL(11, 6)) AS "_o__c0" +FROM (SELECT "ss_quantity", "ss_ext_list_price" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 1 AND 20 + hive.sql.query.fieldNames _o__c0 + hive.sql.query.fieldTypes decimal(11,6) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _o__c0 (type: decimal(11,6)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 19 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_net_paid_inc_tax") / COUNT("ss_net_paid_inc_tax") AS DECIMAL(11, 6)) AS "_o__c0" +FROM (SELECT "ss_quantity", "ss_net_paid_inc_tax" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 1 AND 20 + hive.sql.query.fieldNames _o__c0 + hive.sql.query.fieldTypes decimal(11,6) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _o__c0 (type: decimal(11,6)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 20 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) > 4595804 +FROM (SELECT "ss_quantity" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 21 AND 40 + hive.sql.query.fieldNames EXPR$1 + hive.sql.query.fieldTypes boolean + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: expr$1 (type: boolean) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 21 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_ext_list_price") / COUNT("ss_ext_list_price") AS DECIMAL(11, 6)) AS "_o__c0" +FROM (SELECT "ss_quantity", "ss_ext_list_price" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 21 AND 40 + hive.sql.query.fieldNames _o__c0 + hive.sql.query.fieldTypes decimal(11,6) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _o__c0 (type: decimal(11,6)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 22 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_net_paid_inc_tax") / COUNT("ss_net_paid_inc_tax") AS DECIMAL(11, 6)) AS "_o__c0" +FROM (SELECT "ss_quantity", "ss_net_paid_inc_tax" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 21 AND 40 + hive.sql.query.fieldNames _o__c0 + hive.sql.query.fieldTypes decimal(11,6) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _o__c0 (type: decimal(11,6)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 23 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) > 7887297 +FROM (SELECT "ss_quantity" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 41 AND 60 + hive.sql.query.fieldNames EXPR$2 + hive.sql.query.fieldTypes boolean + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: expr$2 (type: boolean) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 24 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_ext_list_price") / COUNT("ss_ext_list_price") AS DECIMAL(11, 6)) AS "_o__c0" +FROM (SELECT "ss_quantity", "ss_ext_list_price" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 41 AND 60 + hive.sql.query.fieldNames _o__c0 + hive.sql.query.fieldTypes decimal(11,6) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _o__c0 (type: decimal(11,6)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 25 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_net_paid_inc_tax") / COUNT("ss_net_paid_inc_tax") AS DECIMAL(11, 6)) AS "_o__c0" +FROM (SELECT "ss_quantity", "ss_net_paid_inc_tax" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 41 AND 60 + hive.sql.query.fieldNames _o__c0 + hive.sql.query.fieldTypes decimal(11,6) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _o__c0 (type: decimal(11,6)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 26 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) > 10872978 +FROM (SELECT "ss_quantity" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 61 AND 80 + hive.sql.query.fieldNames EXPR$3 + hive.sql.query.fieldTypes boolean + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: expr$3 (type: boolean) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 27 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_ext_list_price") / COUNT("ss_ext_list_price") AS DECIMAL(11, 6)) AS "_o__c0" +FROM (SELECT "ss_quantity", "ss_ext_list_price" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 61 AND 80 + hive.sql.query.fieldNames _o__c0 + hive.sql.query.fieldTypes decimal(11,6) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _o__c0 (type: decimal(11,6)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 28 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_net_paid_inc_tax") / COUNT("ss_net_paid_inc_tax") AS DECIMAL(11, 6)) AS "_o__c0" +FROM (SELECT "ss_quantity", "ss_net_paid_inc_tax" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 61 AND 80 + hive.sql.query.fieldNames _o__c0 + hive.sql.query.fieldTypes decimal(11,6) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _o__c0 (type: decimal(11,6)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 29 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) > 43571537 +FROM (SELECT "ss_quantity" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 81 AND 100 + hive.sql.query.fieldNames EXPR$4 + hive.sql.query.fieldTypes boolean + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: expr$4 (type: boolean) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: boolean) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 30 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_ext_list_price") / COUNT("ss_ext_list_price") AS DECIMAL(11, 6)) AS "_o__c0" +FROM (SELECT "ss_quantity", "ss_ext_list_price" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 81 AND 100 + hive.sql.query.fieldNames _o__c0 + hive.sql.query.fieldTypes decimal(11,6) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _o__c0 (type: decimal(11,6)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 31 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT CAST(SUM("ss_net_paid_inc_tax") / COUNT("ss_net_paid_inc_tax") AS DECIMAL(11, 6)) AS "_o__c0" +FROM (SELECT "ss_quantity", "ss_net_paid_inc_tax" +FROM "store_sales") AS "t" +WHERE "ss_quantity" BETWEEN 81 AND 100 + hive.sql.query.fieldNames _o__c0 + hive.sql.query.fieldTypes decimal(11,6) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _o__c0 (type: decimal(11,6)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 112 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: decimal(11,6)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 10 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9 + Statistics: Num rows: 1 Data size: 693 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 693 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)), _col3 (type: decimal(11,6)), _col4 (type: boolean), _col5 (type: decimal(11,6)), _col6 (type: decimal(11,6)), _col7 (type: boolean), _col8 (type: decimal(11,6)), _col9 (type: decimal(11,6)) + Reducer 11 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10 + Statistics: Num rows: 1 Data size: 698 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 698 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)), _col3 (type: decimal(11,6)), _col4 (type: boolean), _col5 (type: decimal(11,6)), _col6 (type: decimal(11,6)), _col7 (type: boolean), _col8 (type: decimal(11,6)), _col9 (type: decimal(11,6)), _col10 (type: boolean) + Reducer 12 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11 + Statistics: Num rows: 1 Data size: 811 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 811 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)), _col3 (type: decimal(11,6)), _col4 (type: boolean), _col5 (type: decimal(11,6)), _col6 (type: decimal(11,6)), _col7 (type: boolean), _col8 (type: decimal(11,6)), _col9 (type: decimal(11,6)), _col10 (type: boolean), _col11 (type: decimal(11,6)) + Reducer 13 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12 + Statistics: Num rows: 1 Data size: 924 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 924 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)), _col3 (type: decimal(11,6)), _col4 (type: boolean), _col5 (type: decimal(11,6)), _col6 (type: decimal(11,6)), _col7 (type: boolean), _col8 (type: decimal(11,6)), _col9 (type: decimal(11,6)), _col10 (type: boolean), _col11 (type: decimal(11,6)), _col12 (type: decimal(11,6)) + Reducer 14 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13 + Statistics: Num rows: 1 Data size: 929 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 929 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)), _col3 (type: decimal(11,6)), _col4 (type: boolean), _col5 (type: decimal(11,6)), _col6 (type: decimal(11,6)), _col7 (type: boolean), _col8 (type: decimal(11,6)), _col9 (type: decimal(11,6)), _col10 (type: boolean), _col11 (type: decimal(11,6)), _col12 (type: decimal(11,6)), _col13 (type: boolean) + Reducer 15 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14 + Statistics: Num rows: 1 Data size: 1042 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 1042 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)), _col3 (type: decimal(11,6)), _col4 (type: boolean), _col5 (type: decimal(11,6)), _col6 (type: decimal(11,6)), _col7 (type: boolean), _col8 (type: decimal(11,6)), _col9 (type: decimal(11,6)), _col10 (type: boolean), _col11 (type: decimal(11,6)), _col12 (type: decimal(11,6)), _col13 (type: boolean), _col14 (type: decimal(11,6)) + Reducer 16 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8, _col9, _col10, _col11, _col12, _col13, _col14, _col15 + Statistics: Num rows: 1 Data size: 1155 Basic stats: PARTIAL Column stats: NONE + Select Operator + expressions: if(_col1, _col2, _col3) (type: decimal(11,6)), if(_col4, _col5, _col6) (type: decimal(11,6)), if(_col7, _col8, _col9) (type: decimal(11,6)), if(_col10, _col11, _col12) (type: decimal(11,6)), if(_col13, _col14, _col15) (type: decimal(11,6)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 1155 Basic stats: PARTIAL Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 1155 Basic stats: PARTIAL Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1 + Statistics: Num rows: 1 Data size: 5 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 5 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2 + Statistics: Num rows: 1 Data size: 118 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 118 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3 + Statistics: Num rows: 1 Data size: 231 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 231 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)), _col3 (type: decimal(11,6)) + Reducer 5 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4 + Statistics: Num rows: 1 Data size: 236 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 236 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)), _col3 (type: decimal(11,6)), _col4 (type: boolean) + Reducer 6 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 349 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 349 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)), _col3 (type: decimal(11,6)), _col4 (type: boolean), _col5 (type: decimal(11,6)) + Reducer 7 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 462 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 462 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)), _col3 (type: decimal(11,6)), _col4 (type: boolean), _col5 (type: decimal(11,6)), _col6 (type: decimal(11,6)) + Reducer 8 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 467 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 467 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)), _col3 (type: decimal(11,6)), _col4 (type: boolean), _col5 (type: decimal(11,6)), _col6 (type: decimal(11,6)), _col7 (type: boolean) + Reducer 9 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Outer Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 1 Data size: 580 Basic stats: PARTIAL Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 580 Basic stats: PARTIAL Column stats: NONE + value expressions: _col1 (type: boolean), _col2 (type: decimal(11,6)), _col3 (type: decimal(11,6)), _col4 (type: boolean), _col5 (type: decimal(11,6)), _col6 (type: decimal(11,6)), _col7 (type: boolean), _col8 (type: decimal(11,6)) + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query90.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query90.q.out new file mode 100644 index 000000000000..d9d47fff0682 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query90.q.out @@ -0,0 +1,116 @@ +Warning: Shuffle Join MERGEJOIN[9][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (XPROD_EDGE), Map 3 (XPROD_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT COUNT(*) AS "$f0" +FROM (SELECT "ws_sold_time_sk", "ws_ship_hdemo_sk", "ws_web_page_sk" +FROM (SELECT "ws_sold_time_sk", "ws_ship_hdemo_sk", "ws_web_page_sk" +FROM "web_sales") AS "t" +WHERE "ws_ship_hdemo_sk" IS NOT NULL AND "ws_sold_time_sk" IS NOT NULL AND "ws_web_page_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count" +FROM "household_demographics") AS "t2" +WHERE "hd_dep_count" = 8 AND "hd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ws_ship_hdemo_sk" = "t4"."hd_demo_sk" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_hour" +FROM "time_dim") AS "t5" +WHERE "t_hour" BETWEEN 6 AND 7 AND "t_time_sk" IS NOT NULL) AS "t7" ON "t1"."ws_sold_time_sk" = "t7"."t_time_sk" +INNER JOIN (SELECT "wp_web_page_sk" +FROM (SELECT "wp_web_page_sk", "wp_char_count" +FROM "web_page") AS "t8" +WHERE "wp_char_count" BETWEEN 5000 AND 5200 AND "wp_web_page_sk" IS NOT NULL) AS "t10" ON "t1"."ws_web_page_sk" = "t10"."wp_web_page_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 3 + Map Operator Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT COUNT(*) AS "$f0" +FROM (SELECT "ws_sold_time_sk", "ws_ship_hdemo_sk", "ws_web_page_sk" +FROM (SELECT "ws_sold_time_sk", "ws_ship_hdemo_sk", "ws_web_page_sk" +FROM "web_sales") AS "t" +WHERE "ws_ship_hdemo_sk" IS NOT NULL AND "ws_sold_time_sk" IS NOT NULL AND "ws_web_page_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count" +FROM "household_demographics") AS "t2" +WHERE "hd_dep_count" = 8 AND "hd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ws_ship_hdemo_sk" = "t4"."hd_demo_sk" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_hour" +FROM "time_dim") AS "t5" +WHERE "t_hour" BETWEEN 14 AND 15 AND "t_time_sk" IS NOT NULL) AS "t7" ON "t1"."ws_sold_time_sk" = "t7"."t_time_sk" +INNER JOIN (SELECT "wp_web_page_sk" +FROM (SELECT "wp_web_page_sk", "wp_char_count" +FROM "web_page") AS "t8" +WHERE "wp_char_count" BETWEEN 5000 AND 5200 AND "wp_web_page_sk" IS NOT NULL) AS "t10" ON "t1"."ws_web_page_sk" = "t10"."wp_web_page_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: $f0 (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 + 1 + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 17 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: (CAST( _col0 AS decimal(15,4)) / CAST( _col1 AS decimal(15,4))) (type: decimal(35,20)) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 17 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 17 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query91.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query91.q.out new file mode 100644 index 000000000000..25a17814089d --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query91.q.out @@ -0,0 +1,52 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: customer + properties: + hive.sql.query SELECT "t23"."call_center", "t23"."call_center_name", "t23"."manager", "t23"."returns_loss" +FROM (SELECT "t20"."cc_call_center_id" AS "call_center", "t20"."cc_name" AS "call_center_name", "t20"."cc_manager" AS "manager", SUM("t20"."cr_net_loss") AS "returns_loss", SUM("t20"."cr_net_loss") AS "(tok_function sum (tok_table_or_col cr_net_loss))" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_hdemo_sk", "c_current_addr_sk" +FROM (SELECT "c_customer_sk", "c_current_cdemo_sk", "c_current_hdemo_sk", "c_current_addr_sk" +FROM "customer") AS "t" +WHERE "c_customer_sk" IS NOT NULL AND "c_current_addr_sk" IS NOT NULL AND "c_current_cdemo_sk" IS NOT NULL AND "c_current_hdemo_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ca_address_sk" +FROM (SELECT "ca_address_sk", "ca_gmt_offset" +FROM "customer_address") AS "t2" +WHERE "ca_gmt_offset" = -7 AND "ca_address_sk" IS NOT NULL) AS "t4" ON "t1"."c_current_addr_sk" = "t4"."ca_address_sk" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_buy_potential" +FROM "household_demographics") AS "t5" +WHERE "hd_buy_potential" LIKE '0-500%' AND "hd_demo_sk" IS NOT NULL) AS "t7" ON "t1"."c_current_hdemo_sk" = "t7"."hd_demo_sk" +INNER JOIN (SELECT "cd_demo_sk", "cd_marital_status", "cd_education_status" +FROM (SELECT "cd_demo_sk", "cd_marital_status", "cd_education_status" +FROM "customer_demographics") AS "t8" +WHERE ("cd_marital_status" = 'M' AND "cd_education_status" = 'Unknown' OR "cd_marital_status" = 'W' AND "cd_education_status" = 'Advanced Degree') AND "cd_marital_status" IN ('M', 'W') AND "cd_education_status" IN ('Advanced Degree', 'Unknown') AND "cd_demo_sk" IS NOT NULL) AS "t10" ON "t1"."c_current_cdemo_sk" = "t10"."cd_demo_sk" +INNER JOIN (SELECT "t13"."cr_returned_date_sk", "t13"."cr_returning_customer_sk", "t13"."cr_call_center_sk", "t13"."cr_net_loss", "t16"."d_date_sk", "t19"."cc_call_center_sk", "t19"."cc_call_center_id", "t19"."cc_name", "t19"."cc_manager" +FROM (SELECT "cr_returned_date_sk", "cr_returning_customer_sk", "cr_call_center_sk", "cr_net_loss" +FROM (SELECT "cr_returned_date_sk", "cr_returning_customer_sk", "cr_call_center_sk", "cr_net_loss" +FROM "catalog_returns") AS "t11" +WHERE "cr_call_center_sk" IS NOT NULL AND "cr_returned_date_sk" IS NOT NULL AND "cr_returning_customer_sk" IS NOT NULL) AS "t13" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_year", "d_moy" +FROM "date_dim") AS "t14" +WHERE "d_year" = 1999 AND "d_moy" = 11 AND "d_date_sk" IS NOT NULL) AS "t16" ON "t13"."cr_returned_date_sk" = "t16"."d_date_sk" +INNER JOIN (SELECT "cc_call_center_sk", "cc_call_center_id", "cc_name", "cc_manager" +FROM (SELECT "cc_call_center_sk", "cc_call_center_id", "cc_name", "cc_manager" +FROM "call_center") AS "t17" +WHERE "cc_call_center_sk" IS NOT NULL) AS "t19" ON "t13"."cr_call_center_sk" = "t19"."cc_call_center_sk") AS "t20" ON "t1"."c_customer_sk" = "t20"."cr_returning_customer_sk" +GROUP BY "t10"."cd_marital_status", "t10"."cd_education_status", "t20"."cc_call_center_id", "t20"."cc_name", "t20"."cc_manager" +ORDER BY SUM("t20"."cr_net_loss") DESC) AS "t23" + hive.sql.query.fieldNames call_center,call_center_name,manager,returns_loss + hive.sql.query.fieldTypes string,string,string,decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: call_center (type: string), call_center_name (type: string), manager (type: string), returns_loss (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query92.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query92.q.out new file mode 100644 index 000000000000..e9ea54cd09a7 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query92.q.out @@ -0,0 +1,43 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: web_sales + properties: + hive.sql.query SELECT SUM("t1"."ws_ext_discount_amt") AS "$f0" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_ext_discount_amt" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_ext_discount_amt" +FROM "web_sales") AS "t" +WHERE "ws_item_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL AND "ws_ext_discount_amt" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "i_item_sk" +FROM (SELECT "i_item_sk", "i_manufact_id" +FROM "item") AS "t2" +WHERE "i_manufact_id" = 269 AND "i_item_sk" IS NOT NULL) AS "t4" ON "t1"."ws_item_sk" = "t4"."i_item_sk" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t5" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '1998-03-18 00:00:00.000000000' AND TIMESTAMP '1998-06-16 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t7" ON "t1"."ws_sold_date_sk" = "t7"."d_date_sk" +INNER JOIN (SELECT 1.3 * CAST(SUM("t10"."ws_ext_discount_amt") / COUNT("t10"."ws_ext_discount_amt") AS DECIMAL(11, 6)) AS "_o__c0", "t10"."ws_item_sk" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_ext_discount_amt" +FROM (SELECT "ws_sold_date_sk", "ws_item_sk", "ws_ext_discount_amt" +FROM "web_sales") AS "t8" +WHERE "ws_item_sk" IS NOT NULL AND "ws_sold_date_sk" IS NOT NULL) AS "t10" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t11" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '1998-03-18 00:00:00.000000000' AND TIMESTAMP '1998-06-16 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t13" ON "t10"."ws_sold_date_sk" = "t13"."d_date_sk" +GROUP BY "t10"."ws_item_sk" +HAVING CAST(SUM("t10"."ws_ext_discount_amt") / COUNT("t10"."ws_ext_discount_amt") AS DECIMAL(11, 6)) IS NOT NULL) AS "t16" ON "t4"."i_item_sk" = "t16"."ws_item_sk" AND "t1"."ws_ext_discount_amt" > "t16"."_o__c0" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes decimal(17,2) + hive.sql.query.split false + Select Operator + expressions: $f0 (type: decimal(17,2)) + outputColumnNames: _col0 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query93.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query93.q.out new file mode 100644 index 000000000000..4d1560ae8035 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query93.q.out @@ -0,0 +1,36 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_returns + properties: + hive.sql.query SELECT "t10"."$f0", "t10"."$f1" +FROM (SELECT "t7"."ss_customer_sk" AS "$f0", SUM(CASE WHEN "t1"."EXPR$0" THEN CAST("t7"."ss_quantity" - "t1"."sr_return_quantity" AS DECIMAL(10, 0)) * "t7"."ss_sales_price" ELSE "t7"."EXPR$0" END) AS "$f1" +FROM (SELECT "sr_item_sk", "sr_reason_sk", "sr_ticket_number", "sr_return_quantity", "sr_return_quantity" IS NOT NULL AS "EXPR$0" +FROM (SELECT "sr_item_sk", "sr_reason_sk", "sr_ticket_number", "sr_return_quantity" +FROM "store_returns") AS "t" +WHERE "sr_item_sk" IS NOT NULL AND "sr_ticket_number" IS NOT NULL AND "sr_reason_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "r_reason_sk" +FROM (SELECT "r_reason_sk", "r_reason_desc" +FROM "reason") AS "t2" +WHERE "r_reason_desc" = 'Did not like the warranty' AND "r_reason_sk" IS NOT NULL) AS "t4" ON "t1"."sr_reason_sk" = "t4"."r_reason_sk" +INNER JOIN (SELECT "ss_item_sk", "ss_customer_sk", "ss_ticket_number", "ss_quantity", "ss_sales_price", CAST("ss_quantity" AS DECIMAL(10, 0)) * "ss_sales_price" AS "EXPR$0" +FROM (SELECT "ss_item_sk", "ss_customer_sk", "ss_ticket_number", "ss_quantity", "ss_sales_price" +FROM "store_sales") AS "t5" +WHERE "ss_item_sk" IS NOT NULL AND "ss_ticket_number" IS NOT NULL) AS "t7" ON "t1"."sr_item_sk" = "t7"."ss_item_sk" AND "t1"."sr_ticket_number" = "t7"."ss_ticket_number" +GROUP BY "t7"."ss_customer_sk" +ORDER BY SUM(CASE WHEN "t1"."EXPR$0" THEN CAST("t7"."ss_quantity" - "t1"."sr_return_quantity" AS DECIMAL(10, 0)) * "t7"."ss_sales_price" ELSE "t7"."EXPR$0" END), "t7"."ss_customer_sk" +FETCH NEXT 100 ROWS ONLY) AS "t10" + hive.sql.query.fieldNames $f0,$f1 + hive.sql.query.fieldTypes int,decimal(28,2) + hive.sql.query.split false + Select Operator + expressions: $f0 (type: int), $f1 (type: decimal(28,2)) + outputColumnNames: _col0, _col1 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query94.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query94.q.out new file mode 100644 index 000000000000..0807f6e5efa4 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query94.q.out @@ -0,0 +1,206 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE) + Reducer 3 <- Map 7 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (CUSTOM_SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: ws1 + properties: + hive.sql.query SELECT "t1"."ws_ship_date_sk", "t1"."ws_ship_addr_sk", "t1"."ws_web_site_sk", "t1"."ws_warehouse_sk", "t1"."ws_order_number", "t1"."ws_ext_ship_cost", "t1"."ws_net_profit", "t4"."d_date_sk", "t4"."d_date", "t7"."ca_address_sk", "t7"."ca_state", "t10"."web_site_sk", "t10"."web_company_name" +FROM (SELECT "ws_ship_date_sk", "ws_ship_addr_sk", "ws_web_site_sk", "ws_warehouse_sk", "ws_order_number", "ws_ext_ship_cost", "ws_net_profit" +FROM (SELECT "ws_ship_date_sk", "ws_ship_addr_sk", "ws_web_site_sk", "ws_warehouse_sk", "ws_order_number", "ws_ext_ship_cost", "ws_net_profit" +FROM "web_sales") AS "t" +WHERE "ws_ship_date_sk" IS NOT NULL AND "ws_ship_addr_sk" IS NOT NULL AND "ws_web_site_sk" IS NOT NULL AND "ws_order_number" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t2" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '1999-05-01 00:00:00.000000000' AND TIMESTAMP '1999-06-30 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_ship_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_state" +FROM (SELECT "ca_address_sk", "ca_state" +FROM "customer_address") AS "t5" +WHERE "ca_state" = 'TX' AND "ca_address_sk" IS NOT NULL) AS "t7" ON "t1"."ws_ship_addr_sk" = "t7"."ca_address_sk" +INNER JOIN (SELECT "web_site_sk", "web_company_name" +FROM (SELECT "web_site_sk", "web_company_name" +FROM "web_site") AS "t8" +WHERE "web_company_name" = 'pri' AND "web_site_sk" IS NOT NULL) AS "t10" ON "t1"."ws_web_site_sk" = "t10"."web_site_sk" + hive.sql.query.fieldNames ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,d_date_sk,d_date,ca_address_sk,ca_state,web_site_sk,web_company_name + hive.sql.query.fieldTypes int,int,int,int,bigint,decimal(7,2),decimal(7,2),int,string,int,string,int,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_warehouse_sk (type: int), ws_order_number (type: bigint), ws_ext_ship_cost (type: decimal(7,2)), ws_net_profit (type: decimal(7,2)) + outputColumnNames: _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col4 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col4 (type: bigint) + Statistics: Num rows: 1 Data size: 236 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: int), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: ws2 + properties: + hive.sql.query SELECT "ws_warehouse_sk", "ws_order_number" +FROM (SELECT "ws_warehouse_sk", "ws_order_number" +FROM "web_sales") AS "t" +WHERE "ws_order_number" IS NOT NULL AND "ws_warehouse_sk" IS NOT NULL + hive.sql.query.fieldNames ws_warehouse_sk,ws_order_number + hive.sql.query.fieldTypes int,bigint + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_order_number (type: bigint), ws_warehouse_sk (type: int) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: bigint), _col1 (type: int) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: wr1 + properties: + hive.sql.query SELECT TRUE AS "literalTrue", "wr_order_number" +FROM (SELECT "wr_order_number" +FROM "web_returns") AS "t" +WHERE "wr_order_number" IS NOT NULL + hive.sql.query.fieldNames literalTrue,wr_order_number + hive.sql.query.fieldTypes boolean,bigint + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: wr_order_number (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col4 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col3, _col4, _col5, _col6, _col14 + residual filter predicates: {(_col3 <> _col14)} + Statistics: Num rows: 1 Data size: 259 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col4 (type: bigint), _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)) + outputColumnNames: _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 259 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col4 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col4 (type: bigint) + Statistics: Num rows: 1 Data size: 259 Basic stats: COMPLETE Column stats: NONE + value expressions: _col5 (type: decimal(7,2)), _col6 (type: decimal(7,2)) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Anti Join 0 to 1 + keys: + 0 _col4 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 284 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col5), sum(_col6) + keys: _col4 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col2, _col3 + Statistics: Num rows: 1 Data size: 284 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 284 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(17,2)), _col3 (type: decimal(17,2)) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1) + keys: KEY._col0 (type: bigint) + mode: partial2 + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 284 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count(_col0), sum(_col1), sum(_col2) + mode: partial2 + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 344 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 344 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: decimal(17,2)), _col2 (type: decimal(17,2)) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0), sum(VALUE._col1), sum(VALUE._col2) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 344 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 344 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query95.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query95.q.out new file mode 100644 index 000000000000..22328c7c0822 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query95.q.out @@ -0,0 +1,214 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE) + Reducer 3 <- Map 7 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (CUSTOM_SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: ws1 + properties: + hive.sql.query SELECT "t1"."ws_ship_date_sk", "t1"."ws_ship_addr_sk", "t1"."ws_web_site_sk", "t1"."ws_order_number", "t1"."ws_ext_ship_cost", "t1"."ws_net_profit", "t4"."d_date_sk", "t4"."d_date", "t7"."ca_address_sk", "t7"."ca_state", "t10"."web_site_sk", "t10"."web_company_name" +FROM (SELECT "ws_ship_date_sk", "ws_ship_addr_sk", "ws_web_site_sk", "ws_order_number", "ws_ext_ship_cost", "ws_net_profit" +FROM (SELECT "ws_ship_date_sk", "ws_ship_addr_sk", "ws_web_site_sk", "ws_order_number", "ws_ext_ship_cost", "ws_net_profit" +FROM "web_sales") AS "t" +WHERE "ws_order_number" IS NOT NULL AND "ws_ship_date_sk" IS NOT NULL AND "ws_ship_addr_sk" IS NOT NULL AND "ws_web_site_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk", "d_date" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t2" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '1999-05-01 00:00:00.000000000' AND TIMESTAMP '1999-06-30 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ws_ship_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "ca_address_sk", "ca_state" +FROM (SELECT "ca_address_sk", "ca_state" +FROM "customer_address") AS "t5" +WHERE "ca_state" = 'TX' AND "ca_address_sk" IS NOT NULL) AS "t7" ON "t1"."ws_ship_addr_sk" = "t7"."ca_address_sk" +INNER JOIN (SELECT "web_site_sk", "web_company_name" +FROM (SELECT "web_site_sk", "web_company_name" +FROM "web_site") AS "t8" +WHERE "web_company_name" = 'pri' AND "web_site_sk" IS NOT NULL) AS "t10" ON "t1"."ws_web_site_sk" = "t10"."web_site_sk" + hive.sql.query.fieldNames ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,d_date_sk,d_date,ca_address_sk,ca_state,web_site_sk,web_company_name + hive.sql.query.fieldTypes int,int,int,bigint,decimal(7,2),decimal(7,2),int,string,int,string,int,string + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_order_number (type: bigint), ws_ext_ship_cost (type: decimal(7,2)), ws_net_profit (type: decimal(7,2)) + outputColumnNames: _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col3 (type: bigint) + Statistics: Num rows: 1 Data size: 232 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: decimal(7,2)), _col5 (type: decimal(7,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 6 + Map Operator Tree: + TableScan + alias: ws1 + properties: + hive.sql.query SELECT "t1"."ws_order_number" +FROM (SELECT "ws_warehouse_sk", "ws_order_number" +FROM (SELECT "ws_warehouse_sk", "ws_order_number" +FROM "web_sales") AS "t" +WHERE "ws_order_number" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "ws_warehouse_sk", "ws_order_number" +FROM (SELECT "ws_warehouse_sk", "ws_order_number" +FROM "web_sales") AS "t2" +WHERE "ws_order_number" IS NOT NULL) AS "t4" ON "t1"."ws_order_number" = "t4"."ws_order_number" AND "t1"."ws_warehouse_sk" <> "t4"."ws_warehouse_sk" + hive.sql.query.fieldNames ws_order_number + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: ws_order_number (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: ws1 + properties: + hive.sql.query SELECT "t4"."wr_order_number" +FROM (SELECT "ws_warehouse_sk", "ws_order_number" +FROM (SELECT "ws_warehouse_sk", "ws_order_number" +FROM "web_sales") AS "t" +WHERE "ws_order_number" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "wr_order_number" +FROM (SELECT "wr_order_number" +FROM "web_returns") AS "t2" +WHERE "wr_order_number" IS NOT NULL) AS "t4" ON "t1"."ws_order_number" = "t4"."wr_order_number" +INNER JOIN (SELECT "ws_warehouse_sk", "ws_order_number" +FROM (SELECT "ws_warehouse_sk", "ws_order_number" +FROM "web_sales") AS "t5" +WHERE "ws_order_number" IS NOT NULL) AS "t7" ON "t1"."ws_order_number" = "t7"."ws_order_number" AND "t1"."ws_warehouse_sk" <> "t7"."ws_warehouse_sk" + hive.sql.query.fieldNames wr_order_number + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: wr_order_number (type: bigint) + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Group By Operator + keys: _col0 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0 + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col3 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 255 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col3 (type: bigint) + Statistics: Num rows: 1 Data size: 255 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: decimal(7,2)), _col5 (type: decimal(7,2)) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Left Semi Join 0 to 1 + keys: + 0 _col3 (type: bigint) + 1 _col0 (type: bigint) + outputColumnNames: _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 280 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: sum(_col4), sum(_col5) + keys: _col3 (type: bigint) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col2, _col3 + Statistics: Num rows: 1 Data size: 280 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: bigint) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: bigint) + Statistics: Num rows: 1 Data size: 280 Basic stats: COMPLETE Column stats: NONE + value expressions: _col2 (type: decimal(17,2)), _col3 (type: decimal(17,2)) + Reducer 4 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1) + keys: KEY._col0 (type: bigint) + mode: partial2 + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 280 Basic stats: COMPLETE Column stats: NONE + Group By Operator + aggregations: count(_col0), sum(_col1), sum(_col2) + mode: partial2 + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 344 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + null sort order: + sort order: + Statistics: Num rows: 1 Data size: 344 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: bigint), _col1 (type: decimal(17,2)), _col2 (type: decimal(17,2)) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: count(VALUE._col0), sum(VALUE._col1), sum(VALUE._col2) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2 + Statistics: Num rows: 1 Data size: 344 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 344 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query96.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query96.q.out new file mode 100644 index 000000000000..c2c1e4ccf704 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query96.q.out @@ -0,0 +1,36 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT COUNT(*) AS "$f0" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM (SELECT "ss_sold_time_sk", "ss_hdemo_sk", "ss_store_sk" +FROM "store_sales") AS "t" +WHERE "ss_hdemo_sk" IS NOT NULL AND "ss_sold_time_sk" IS NOT NULL AND "ss_store_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "hd_demo_sk" +FROM (SELECT "hd_demo_sk", "hd_dep_count" +FROM "household_demographics") AS "t2" +WHERE "hd_dep_count" = 5 AND "hd_demo_sk" IS NOT NULL) AS "t4" ON "t1"."ss_hdemo_sk" = "t4"."hd_demo_sk" +INNER JOIN (SELECT "t_time_sk" +FROM (SELECT "t_time_sk", "t_hour", "t_minute" +FROM "time_dim") AS "t5" +WHERE "t_minute" >= 30 AND "t_hour" = 8 AND "t_time_sk" IS NOT NULL) AS "t7" ON "t1"."ss_sold_time_sk" = "t7"."t_time_sk" +INNER JOIN (SELECT "s_store_sk" +FROM (SELECT "s_store_sk", "s_store_name" +FROM "store") AS "t8" +WHERE "s_store_name" = 'ese' AND "s_store_sk" IS NOT NULL) AS "t10" ON "t1"."ss_store_sk" = "t10"."s_store_sk" + hive.sql.query.fieldNames $f0 + hive.sql.query.fieldTypes bigint + hive.sql.query.split false + Select Operator + expressions: $f0 (type: bigint) + outputColumnNames: _col0 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query97.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query97.q.out new file mode 100644 index 000000000000..82b59f5f4505 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query97.q.out @@ -0,0 +1,40 @@ +STAGE DEPENDENCIES: + Stage-0 is a root stage + +STAGE PLANS: + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT SUM(CAST(CASE WHEN "t13"."cs_bill_customer_sk" IS NULL AND "t6"."ss_customer_sk" IS NOT NULL THEN 1 ELSE 0 END AS INTEGER)) AS "$f0", SUM(CAST(CASE WHEN "t6"."ss_customer_sk" IS NULL AND "t13"."cs_bill_customer_sk" IS NOT NULL THEN 1 ELSE 0 END AS INTEGER)) AS "$f1", SUM(CAST(CASE WHEN "t6"."ss_customer_sk" IS NOT NULL AND "t13"."cs_bill_customer_sk" IS NOT NULL THEN 1 ELSE 0 END AS INTEGER)) AS "$f2" +FROM (SELECT "t1"."ss_customer_sk", "t1"."ss_item_sk" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_customer_sk" +FROM "store_sales") AS "t" +WHERE "ss_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM "date_dim") AS "t2" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +GROUP BY "t1"."ss_item_sk", "t1"."ss_customer_sk") AS "t6" +FULL JOIN (SELECT "t9"."cs_bill_customer_sk", "t9"."cs_item_sk" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk" +FROM (SELECT "cs_sold_date_sk", "cs_bill_customer_sk", "cs_item_sk" +FROM "catalog_sales") AS "t7" +WHERE "cs_sold_date_sk" IS NOT NULL) AS "t9" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM "date_dim") AS "t10" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t12" ON "t9"."cs_sold_date_sk" = "t12"."d_date_sk" +GROUP BY "t9"."cs_bill_customer_sk", "t9"."cs_item_sk") AS "t13" ON "t6"."ss_customer_sk" = "t13"."cs_bill_customer_sk" AND "t6"."ss_item_sk" = "t13"."cs_item_sk" + hive.sql.query.fieldNames $f0,$f1,$f2 + hive.sql.query.fieldTypes bigint,bigint,bigint + hive.sql.query.split false + Select Operator + expressions: $f0 (type: bigint), $f1 (type: bigint), $f2 (type: bigint) + outputColumnNames: _col0, _col1, _col2 + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query98.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query98.q.out new file mode 100644 index 000000000000..c7394542ca3e --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query98.q.out @@ -0,0 +1,107 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE) + Reducer 3 <- Reducer 2 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: store_sales + properties: + hive.sql.query SELECT "t7"."i_item_id", "t7"."i_item_desc", "t7"."i_current_price", "t7"."i_class", "t7"."i_category", SUM("t1"."ss_ext_sales_price") AS "$f5" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ext_sales_price" +FROM (SELECT "ss_sold_date_sk", "ss_item_sk", "ss_ext_sales_price" +FROM "store_sales") AS "t" +WHERE "ss_item_sk" IS NOT NULL AND "ss_sold_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_date" +FROM "date_dim") AS "t2" +WHERE CAST("d_date" AS TIMESTAMP(9)) BETWEEN TIMESTAMP '2001-01-12 00:00:00.000000000' AND TIMESTAMP '2001-02-11 00:00:00.000000000' AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."ss_sold_date_sk" = "t4"."d_date_sk" +INNER JOIN (SELECT "i_item_sk", "i_item_id", "i_item_desc", "i_current_price", "i_class", "i_category" +FROM (SELECT "i_item_sk", "i_item_id", "i_item_desc", "i_current_price", "i_class", "i_category" +FROM "item") AS "t5" +WHERE "i_category" IN ('Books', 'Jewelry', 'Sports') AND "i_item_sk" IS NOT NULL) AS "t7" ON "t1"."ss_item_sk" = "t7"."i_item_sk" +GROUP BY "t7"."i_item_id", "t7"."i_item_desc", "t7"."i_current_price", "t7"."i_class", "t7"."i_category" + hive.sql.query.fieldNames i_item_id,i_item_desc,i_current_price,i_class,i_category,$f5 + hive.sql.query.fieldTypes string,string,decimal(7,2),string,string,decimal(17,2) + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: i_item_id (type: string), i_item_desc (type: string), i_current_price (type: decimal(7,2)), i_class (type: string), i_category (type: string), $f5 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: string) + null sort order: a + sort order: + + Map-reduce partition columns: _col3 (type: string) + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: decimal(7,2)), _col4 (type: string), _col5 (type: decimal(17,2)) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: VALUE._col0 (type: string), VALUE._col1 (type: string), VALUE._col2 (type: decimal(7,2)), KEY.reducesinkkey0 (type: string), VALUE._col3 (type: string), VALUE._col4 (type: decimal(17,2)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + PTF Operator + Function definitions: + Input definition + input alias: ptf_0 + output shape: _col0: string, _col1: string, _col2: decimal(7,2), _col3: string, _col4: string, _col5: decimal(17,2) + type: WINDOWING + Windowing table definition + input alias: ptf_1 + name: windowingtablefunction + order by: _col3 ASC NULLS FIRST + partition by: _col3 + raw input shape: + window functions: + window function definition + alias: sum_window_0 + arguments: _col5 + name: sum + window function: GenericUDAFSumHiveDecimal + window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX) + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col1 (type: string), _col4 (type: string), _col3 (type: string), _col2 (type: decimal(7,2)), _col5 (type: decimal(17,2)), ((_col5 * 100) / sum_window_0) (type: decimal(38,17)), _col0 (type: string) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: string), _col2 (type: string), _col6 (type: string), _col0 (type: string), _col5 (type: decimal(38,17)) + null sort order: zzzzz + sort order: +++++ + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: decimal(7,2)), _col4 (type: decimal(17,2)) + Reducer 3 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey3 (type: string), KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), VALUE._col0 (type: decimal(7,2)), VALUE._col1 (type: decimal(17,2)), KEY.reducesinkkey4 (type: decimal(38,17)) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 960 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + diff --git a/ql/src/test/results/clientpositive/jdbc/postgres/query99.q.out b/ql/src/test/results/clientpositive/jdbc/postgres/query99.q.out new file mode 100644 index 000000000000..0934df9698f1 --- /dev/null +++ b/ql/src/test/results/clientpositive/jdbc/postgres/query99.q.out @@ -0,0 +1,235 @@ +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez +#### A masked pattern was here #### + Edges: + Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE) + Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE) + Reducer 4 <- Map 9 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE) + Reducer 5 <- Reducer 4 (SIMPLE_EDGE) + Reducer 6 <- Reducer 5 (SIMPLE_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: catalog_sales + properties: + hive.sql.query SELECT "t1"."cs_ship_date_sk", "t1"."cs_call_center_sk", "t1"."cs_ship_mode_sk", "t1"."cs_warehouse_sk", "t1"."$f3", "t1"."$f4", "t1"."$f5", "t1"."$f6", "t1"."$f7", "t4"."d_date_sk" +FROM (SELECT "cs_ship_date_sk", "cs_call_center_sk", "cs_ship_mode_sk", "cs_warehouse_sk", CASE WHEN "cs_ship_date_sk" - "cs_sold_date_sk" <= 30 THEN 1 ELSE 0 END AS "$f3", CASE WHEN "cs_ship_date_sk" - "cs_sold_date_sk" > 30 AND "cs_ship_date_sk" - "cs_sold_date_sk" <= 60 THEN 1 ELSE 0 END AS "$f4", CASE WHEN "cs_ship_date_sk" - "cs_sold_date_sk" > 60 AND "cs_ship_date_sk" - "cs_sold_date_sk" <= 90 THEN 1 ELSE 0 END AS "$f5", CASE WHEN "cs_ship_date_sk" - "cs_sold_date_sk" > 90 AND "cs_ship_date_sk" - "cs_sold_date_sk" <= 120 THEN 1 ELSE 0 END AS "$f6", CASE WHEN "cs_ship_date_sk" - "cs_sold_date_sk" > 120 THEN 1 ELSE 0 END AS "$f7" +FROM (SELECT "cs_sold_date_sk", "cs_ship_date_sk", "cs_call_center_sk", "cs_ship_mode_sk", "cs_warehouse_sk" +FROM "catalog_sales") AS "t" +WHERE "cs_warehouse_sk" IS NOT NULL AND "cs_ship_mode_sk" IS NOT NULL AND "cs_call_center_sk" IS NOT NULL AND "cs_ship_date_sk" IS NOT NULL) AS "t1" +INNER JOIN (SELECT "d_date_sk" +FROM (SELECT "d_date_sk", "d_month_seq" +FROM "date_dim") AS "t2" +WHERE "d_month_seq" BETWEEN 1212 AND 1223 AND "d_date_sk" IS NOT NULL) AS "t4" ON "t1"."cs_ship_date_sk" = "t4"."d_date_sk" + hive.sql.query.fieldNames cs_ship_date_sk,cs_call_center_sk,cs_ship_mode_sk,cs_warehouse_sk,$f3,$f4,$f5,$f6,$f7,d_date_sk + hive.sql.query.fieldTypes int,int,int,int,int,int,int,int,int,int + hive.sql.query.split false + Statistics: Num rows: 1 Data size: 32 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cs_call_center_sk (type: int), cs_ship_mode_sk (type: int), cs_warehouse_sk (type: int), $f3 (type: int), $f4 (type: int), $f5 (type: int), $f6 (type: int), $f7 (type: int) + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 1 Data size: 32 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col3 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col3 (type: int) + Statistics: Num rows: 1 Data size: 32 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col2 (type: int), _col4 (type: int), _col5 (type: int), _col6 (type: int), _col7 (type: int), _col8 (type: int) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 7 + Map Operator Tree: + TableScan + alias: warehouse + properties: + hive.sql.query SELECT "w_warehouse_sk", "w_warehouse_name" +FROM (SELECT "w_warehouse_sk", "w_warehouse_name" +FROM "warehouse") AS "t" +WHERE "w_warehouse_sk" IS NOT NULL + hive.sql.query.fieldNames w_warehouse_sk,w_warehouse_name + hive.sql.query.fieldTypes int,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: w_warehouse_sk (type: int), substr(w_warehouse_name, 1, 20) (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 8 + Map Operator Tree: + TableScan + alias: ship_mode + properties: + hive.sql.query SELECT "sm_ship_mode_sk", "sm_type" +FROM (SELECT "sm_ship_mode_sk", "sm_type" +FROM "ship_mode") AS "t" +WHERE "sm_ship_mode_sk" IS NOT NULL + hive.sql.query.fieldNames sm_ship_mode_sk,sm_type + hive.sql.query.fieldTypes int,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: sm_ship_mode_sk (type: int), sm_type (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Map 9 + Map Operator Tree: + TableScan + alias: call_center + properties: + hive.sql.query SELECT "cc_call_center_sk", "cc_name" +FROM (SELECT "cc_call_center_sk", "cc_name" +FROM "call_center") AS "t" +WHERE "cc_call_center_sk" IS NOT NULL + hive.sql.query.fieldNames cc_call_center_sk,cc_name + hive.sql.query.fieldTypes int,string + hive.sql.query.split true + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: cc_call_center_sk (type: int), cc_name (type: string) + outputColumnNames: _col0, _col1 + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col0 (type: int) + Statistics: Num rows: 1 Data size: 188 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: string) + Execution mode: vectorized, llap + LLAP IO: no inputs + Reducer 2 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col3 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col1, _col2, _col4, _col5, _col6, _col7, _col8, _col11 + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col2 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col2 (type: int) + Statistics: Num rows: 1 Data size: 35 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: int), _col4 (type: int), _col5 (type: int), _col6 (type: int), _col7 (type: int), _col8 (type: int), _col11 (type: string) + Reducer 3 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col2 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col1, _col4, _col5, _col6, _col7, _col8, _col11, _col13 + Statistics: Num rows: 1 Data size: 38 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col1 (type: int) + null sort order: z + sort order: + + Map-reduce partition columns: _col1 (type: int) + Statistics: Num rows: 1 Data size: 38 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: int), _col5 (type: int), _col6 (type: int), _col7 (type: int), _col8 (type: int), _col11 (type: string), _col13 (type: string) + Reducer 4 + Execution mode: llap + Reduce Operator Tree: + Merge Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col1 (type: int) + 1 _col0 (type: int) + outputColumnNames: _col4, _col5, _col6, _col7, _col8, _col11, _col13, _col15 + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + Top N Key Operator + sort order: +++ + keys: _col11 (type: string), _col13 (type: string), _col15 (type: string) + null sort order: zzz + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + top n: 100 + Group By Operator + aggregations: sum(_col4), sum(_col5), sum(_col6), sum(_col7), sum(_col8) + keys: _col11 (type: string), _col13 (type: string), _col15 (type: string) + minReductionHashAggr: 0.99 + mode: hash + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string) + null sort order: zzz + sort order: +++ + Map-reduce partition columns: _col0 (type: string), _col1 (type: string), _col2 (type: string) + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint), _col4 (type: bigint), _col5 (type: bigint), _col6 (type: bigint), _col7 (type: bigint) + Reducer 5 + Execution mode: vectorized, llap + Reduce Operator Tree: + Group By Operator + aggregations: sum(VALUE._col0), sum(VALUE._col1), sum(VALUE._col2), sum(VALUE._col3), sum(VALUE._col4) + keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string) + mode: mergepartial + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col1 (type: string), _col2 (type: string), _col3 (type: bigint), _col4 (type: bigint), _col5 (type: bigint), _col6 (type: bigint), _col7 (type: bigint), _col0 (type: string) + outputColumnNames: _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8 + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col8 (type: string), _col1 (type: string), _col2 (type: string) + null sort order: zzz + sort order: +++ + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + value expressions: _col3 (type: bigint), _col4 (type: bigint), _col5 (type: bigint), _col6 (type: bigint), _col7 (type: bigint) + Reducer 6 + Execution mode: vectorized, llap + Reduce Operator Tree: + Select Operator + expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), VALUE._col0 (type: bigint), VALUE._col1 (type: bigint), VALUE._col2 (type: bigint), VALUE._col3 (type: bigint), VALUE._col4 (type: bigint) + outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7 + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + Limit + Number of rows: 100 + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 1 Data size: 41 Basic stats: COMPLETE Column stats: NONE + table: + input format: org.apache.hadoop.mapred.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink +