Skip to content

Instantly share code, notes, and snippets.

View kokosing's full-sized avatar
💤

Grzegorz Kokosiński kokosing

💤
View GitHub Profile
@kokosing
kokosing / QueryPlanner
Created March 9, 2016 09:23
Coercion and subqueries
diff --git a/presto-main/src/main/java/com/facebook/presto/sql/planner/QueryPlanner.java b/presto-main/src/main/java/com/f
index 07606fe..2c3d0aa 100644
--- a/presto-main/src/main/java/com/facebook/presto/sql/planner/QueryPlanner.java
+++ b/presto-main/src/main/java/com/facebook/presto/sql/planner/QueryPlanner.java
@@ -679,10 +679,28 @@ class QueryPlanner
private PlanBuilder appendScalarSubqueryJoin(PlanBuilder builder, SubqueryExpression scalarSubquery)
{
- EnforceSingleRowNode enforceSingleRowNode = new EnforceSingleRowNode(idAllocator.getNextId(), createRelationPlan(
+ PlanNode enforceSingleRowNode = new EnforceSingleRowNode(idAllocator.getNextId(), createRelationPlan(scalarSubque
@kokosing
kokosing / log
Created March 9, 2016 11:41
presto-admin test failure
======================================================================
ERROR: test_build_wheel (tests.unit.test_bdist_prestoadmin.TestBDistPrestoAdmin)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kogut/src/git/prestodb/presto-admin/.tox/py26/lib/python2.6/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)
File "/home/kogut/src/git/prestodb/presto-admin/tests/unit/test_bdist_prestoadmin.py", line 97, in test_build_wheel
self.bdist.build_wheel('build'))
File "/home/kogut/src/git/prestodb/presto-admin/packaging/bdist_prestoadmin.py", line 57, in build_wheel
cmd = self.reinitialize_command('bdist_wheel')
diff q12.sql q12_modified.sql -C 5
*** q12.sql 2016-03-25 14:10:21.906553746 +0100
--- q12_modified.sql 2016-03-25 14:10:21.906553746 +0100
***************
*** 10,20 ****
 WHERE ws_item_sk = i_item_sk
 AND i_category IN ('Men',
 'Music',
 'Women')
 AND ws_sold_date_sk = d_date_sk
! AND d_date BETWEEN cast('2000-01-21' AS date) AND (cast('2000-01-21' AS date) + 30 days)
*** q16.sql 2016-03-25 14:10:21.906553746 +0100
--- q16_modified.sql 2016-03-25 14:10:21.906553746 +0100
***************
*** 3,13 ****
 sum(cs_net_profit) AS "total net profit"
 FROM "${database}"."${schema}".catalog_sales cs1,
 "${database}"."${schema}".date_dim,
 "${database}"."${schema}".customer_address,
 "${database}"."${schema}".call_center
! WHERE d_date BETWEEN '2001-2-01' AND (cast('2001-2-01' AS date) + 60 days)
*** q18.sql 2016-03-25 14:10:21.906553746 +0100
--- q18_modified.sql 2016-03-25 14:10:21.906553746 +0100
***************
*** 1,16 ****
 SELECT i_item_id,
 ca_country,
 ca_state,
 ca_county,
! avg(cast(cs_quantity AS numeric(12,2))) agg1,
! avg(cast(cs_list_price AS numeric(12,2))) agg2,
*** q20.sql 2016-03-25 14:10:21.906553746 +0100
--- q20_modified.sql 2016-03-25 14:10:21.906553746 +0100
***************
*** 10,20 ****
 WHERE cs_item_sk = i_item_sk
 AND i_category IN ('Women',
 'Jewelry',
 'Sports')
 AND cs_sold_date_sk = d_date_sk
! AND d_date BETWEEN cast('2002-06-20' AS date) AND (cast('2002-06-20' AS date) + 30 days)
*** q21.sql 2016-03-25 14:10:21.906553746 +0100
--- q21_modified.sql 2016-03-25 14:10:21.906553746 +0100
***************
*** 10,20 ****
 "${database}"."${schema}".date_dim
 WHERE i_current_price BETWEEN 0.99 AND 1.49
 AND i_item_sk = inv_item_sk
 AND inv_warehouse_sk = w_warehouse_sk
 AND inv_date_sk = d_date_sk
! AND d_date BETWEEN (CAST ('1999-06-23' AS date) - 30 days) AND (CAST ('1999-06-23' AS date) + 30 days)
*** q32.sql 2016-03-25 14:10:21.906553746 +0100
--- q32_modified.sql 2016-03-25 14:10:21.906553746 +0100
***************
*** 2,15 ****
 FROM "${database}"."${schema}".catalog_sales,
 "${database}"."${schema}".item,
 "${database}"."${schema}".date_dim
 WHERE i_manufact_id = 284
 AND i_item_sk = cs_item_sk
! AND d_date BETWEEN '2001-01-07' AND (cast('2001-01-07' AS date) + 90 days)
*** q37.sql 2016-03-25 14:10:21.906553746 +0100
--- q37_modified.sql 2016-03-25 14:10:21.906553746 +0100
***************
*** 6,16 ****
 "${database}"."${schema}".date_dim,
 "${database}"."${schema}".catalog_sales
 WHERE i_current_price BETWEEN 11 AND 11 + 30
 AND inv_item_sk = i_item_sk
 AND d_date_sk=inv_date_sk
! AND d_date BETWEEN cast('1998-01-05' AS date) AND (cast('1998-01-05' AS date) + 60 days)