You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Deneche A. Hakim (JIRA)" <ji...@apache.org> on 2015/01/29 18:57:35 UTC
[jira] [Commented] (DRILL-1953) alter session set
`store.json.all_text_mode` does not work as documented
[ https://issues.apache.org/jira/browse/DRILL-1953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14297243#comment-14297243 ]
Deneche A. Hakim commented on DRILL-1953:
-----------------------------------------
Looking at the source code, the problem seems located in JSONRecordReader's constructor, the following line uses a {{SystemOptionManager}} to fetch the value of the option:
{code}
this.enableAllTextMode = fragmentContext.getDrillbitContext().getOptionManager().getOption(ExecConstants.JSON_ALL_TEXT_MODE).bool_val;
{code}
> alter session set `store.json.all_text_mode` does not work as documented
> ------------------------------------------------------------------------
>
> Key: DRILL-1953
> URL: https://issues.apache.org/jira/browse/DRILL-1953
> Project: Apache Drill
> Issue Type: Bug
> Affects Versions: 0.8.0
> Reporter: Victoria Markman
>
> {code}
> 0: jdbc:drill:schema=dfs> select * from `big_numeric.json`;
> Query failed: Query stopped., Numeric value (14994882832830675451) out of range of long (-9223372036854775808 - 9223372036854775807)
> at [Source: org.apache.drill.exec.vector.complex.fn.JsonReader@44ccf380; line: 0, column: 29] [ 56abe952-c902-41ac-b23b-8f44929a7ddf on atsqa4-134.qa.lab:31010 ]
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> 0: jdbc:drill:schema=dfs> alter session set `store.json.all_text_mode`= true;
> +------------+------------+
> | ok | summary |
> +------------+------------+
> | true | store.json.all_text_mode updated. |
> +------------+------------+
> 1 row selected (0.04 seconds)
> 0: jdbc:drill:schema=dfs> select * from sys.options where name like '%all_text_mode%';
> +------------+------------+------------+------------+------------+------------+------------+
> | name | kind | type | num_val | string_val | bool_val | float_val |
> +------------+------------+------------+------------+------------+------------+------------+
> | store.mongo.all_text_mode | BOOLEAN | SYSTEM | null | null | false | null |
> | store.json.all_text_mode | BOOLEAN | SYSTEM | null | null | false | null |
> | store.json.all_text_mode | BOOLEAN | SESSION | null | null | true | null |
> +------------+------------+------------+------------+------------+------------+------------+
> 3 rows selected (0.14 seconds)
> 0: jdbc:drill:schema=dfs> select * from `big_numeric.json`;
> Query failed: Query stopped., Numeric value (14994882832830675451) out of range of long (-9223372036854775808 - 9223372036854775807)
> at [Source: org.apache.drill.exec.vector.complex.fn.JsonReader@62c6c127; line: 0, column: 29] [ 147edaa9-3969-433c-895a-636d99df108f on atsqa4-134.qa.lab:31010 ]
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> {code}
> When I set this parameter on a SYSTEM level, it seems to work correctly:
> {code}
> 0: jdbc:drill:schema=dfs> alter system set `store.json.all_text_mode`= true;
> +------------+------------+
> | ok | summary |
> +------------+------------+
> | true | store.json.all_text_mode updated. |
> +------------+------------+
> 1 row selected (0.079 seconds)
> 0: jdbc:drill:schema=dfs> select * from `big_numeric.json`;
> +------------+
> | a1 |
> +------------+
> | 14994882832830675451 |
> +------------+
> 1 row selected (0.07 seconds)
> {code}
> Other "ALTER SESSION" parameters that I tried and they seem to work:
> * alter session set `exec.errors.verbose`= true;
> * alter session set `planner.enable_hashjoin`=false;
> * alter session set `planner.enable_hashagg`=false;
> Not the same as DRILL-1769 (see below)
> {code}
> 0: jdbc:drill:schema=dfs> alter session set `planner.enable_hashagg`= false;
> +------------+------------+
> | ok | summary |
> +------------+------------+
> | true | planner.enable_hashagg updated. |
> +------------+------------+
> 1 row selected (0.038 seconds)
> 0: jdbc:drill:schema=dfs> select * from sys.options where name like '%enable_hashagg%' order by name;
> +------------+------------+------------+------------+------------+------------+------------+
> | name | kind | type | num_val | string_val | bool_val | float_val |
> +------------+------------+------------+------------+------------+------------+------------+
> | planner.enable_hashagg | BOOLEAN | SYSTEM | null | null | true | null |
> | planner.enable_hashagg | BOOLEAN | SESSION | null | null | false | null |
> +------------+------------+------------+------------+------------+------------+------------+
> 2 rows selected (0.133 seconds)
> 0: jdbc:drill:schema=dfs> explain plan for select avg(o_totalprice) from cp.`tpch/orders.parquet` group by o_orderdate ;
> +------------+------------+
> | text | json |
> +------------+------------+
> | 00-00 Screen
> 00-01 Project(EXPR$0=[CAST(/(CastHigh(CASE(=($2, 0), null, $1)), $2)):ANY])
> 00-02 StreamAgg(group=[{0}], agg#0=[$SUM0($1)], agg#1=[COUNT($1)])
> 00-03 Sort(sort0=[$0], dir0=[ASC])
> 00-04 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=/tpch/orders.parquet]], selectionRoot=/tpch/orders.parquet, numFiles=1, columns=[`o_orderdate`, `o_totalprice`]]])
> 0: jdbc:drill:schema=dfs> alter session set `planner.enable_streamagg`= false;
> +------------+------------+
> | ok | summary |
> +------------+------------+
> | true | planner.enable_streamagg updated. |
> +------------+------------+
> 1 row selected (0.039 seconds)
> 0: jdbc:drill:schema=dfs> alter session set `planner.enable_hashagg`= true;
> +------------+------------+
> | ok | summary |
> +------------+------------+
> | true | planner.enable_hashagg updated. |
> +------------+------------+
> 1 row selected (0.031 seconds)
> 0: jdbc:drill:schema=dfs> explain plan for select avg(o_totalprice) from cp.`tpch/orders.parquet` group by o_orderdate ;
> +------------+------------+
> | text | json |
> +------------+------------+
> | 00-00 Screen
> 00-01 Project(EXPR$0=[CAST(/(CastHigh(CASE(=($2, 0), null, $1)), $2)):ANY])
> 00-02 HashAgg(group=[{0}], agg#0=[$SUM0($1)], agg#1=[COUNT($1)])
> 00-03 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=/tpch/orders.parquet]], selectionRoot=/tpch/orders.parquet, numFiles=1, columns=[`o_orderdate`, `o_totalprice`]]])
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)