[
https://issues.apache.org/jira/browse/TRAFODION-2729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16148078#comment-16148078
]
ASF GitHub Bot commented on TRAFODION-2729:
-------------------------------------------
GitHub user DaveBirdsall opened a pull request:
https://github.com/apache/incubator-trafodion/pull/1221
[TRAFODION-2729] Fix bug reading region keys for hbase _ROW_, _CELL_ access
At compile time, the NATable layer has logic to construct a metadata
definition when accessing native HBase tables via HBASE."_ROW_".objectName and
HBASE."_CELL_".objectName syntax. Unfortunately, when calling the HBase client
routines to read region key information, the HBASE._ROW_ and HBASE._CELL_
prefixes were passed down as part of the object name. So of course HBase could
not find the object, and the Trafodion compiler would think there was only one
region in the object. That would result in serial plans, even in the presence
of cardinality hints.
The fix is to check for HBASE._ROW_ and HBASE._CELL_ prefixes, and if
present, not pass them down to HBase when reading region keys.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/DaveBirdsall/incubator-trafodion Trafodion2729
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-trafodion/pull/1221.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1221
----
commit edbe1cce9106efac40c0efa9cb2193baca1acf64
Author: Dave Birdsall <[email protected]>
Date: 2017-08-30T21:22:11Z
[TRAFODION-2729] Fix bug reading region keys for hbase _ROW_ and _CELL_
access
----
> Parallel plan not chosen for native HBase table
> -----------------------------------------------
>
> Key: TRAFODION-2729
> URL: https://issues.apache.org/jira/browse/TRAFODION-2729
> Project: Apache Trafodion
> Issue Type: Bug
> Components: sql-cmp
> Affects Versions: 2.3-incubating
> Environment: Probably all
> Reporter: David Wayne Birdsall
>
> If I have a Trafodion table salted into 2 partitions, I can induce a parallel
> plan on that table using a cardinality hint. For example:
> CREATE TABLE TRAFODION.SEABASE.ADEF
> (
> ROW_ID VARCHAR(100) CHARACTER SET ISO88591
> COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE NOT SERIALIZED
> , COLUMN_DETAILS VARCHAR(10000) CHARACTER SET ISO88591
> COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE NOT SERIALIZED
> , PRIMARY KEY (ROW_ID ASC)
> )
> SALT USING 2 PARTITIONS
> ATTRIBUTES ALIGNED FORMAT
> ;
> >>prepare s1 from select column_details,count(*)
> +> from adef <<+ cardinality 1e8 >>
> +> group by column_details;
> --- SQL command prepared.
> >>explain options 'f' s1;
> LC RC OP OPERATOR OPT DESCRIPTION CARD
> ---- ---- ---- -------------------- -------- -------------------- ---------
> 4 . 5 root 2.00E+000
> 3 . 4 hash_partial_groupby 2.00E+000
> 2 . 3 esp_exchange 1:2(hash2) 2.00E+000
> 1 . 2 hash_partial_groupby 2.00E+000
> . . 1 trafodion_scan ADEF 1.00E+008
> --- SQL operation complete.
> However, if I have a native HBase table split into two regions, the same
> cardinality hint does not produce a parallel plan:
> >>prepare s2 from select column_details,count(*)
> +> from hbase."_ROW_"."def" <<+ cardinality 1e8 >>
> +> group by column_details;
> --- SQL command prepared.
> >>explain options 'f' s2;
> LC RC OP OPERATOR OPT DESCRIPTION CARD
> ---- ---- ---- -------------------- -------- -------------------- ---------
> 2 . 3 root 2.00E+000
> 1 . 2 hash_groupby 2.00E+000
> . . 1 hbase_scan def 1.00E+008
> --- SQL operation complete.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)