You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by traflm <gi...@git.apache.org> on 2018/07/16 01:36:59 UTC

[GitHub] trafodion pull request #1646: [TRAFODION-3145] Make "hbase_options" as defau...

GitHub user traflm opened a pull request:

    https://github.com/apache/trafodion/pull/1646

    [TRAFODION-3145] Make "hbase_options" as default setting and use cqd …

    …to change the default setting
    
    As we know, for performance thinking, we always need to add below syntax in “create table” syntax. And I know in latest version, we have made “ATTRIBUTES ALIGNED FORMAT” as default, do we have a plan that make HBASE_OPTIONS(including ENCODING、COMPRESSION、MEMESTORE) as the default setting when creating table? I think this will be easier for end users?
    ATTRIBUTES ALIGNED FORMAT
    HBASE_OPTIONS
    (
    DATA_BLOCK_ENCODING = 'FAST_DIFF',
    COMPRESSION = 'SNAPPY',
    MEMSTORE_FLUSH_SIZE = '1073741824'
    )
    ;
    
    Trafodion has
    cqd HBASE_DATA_BLOCK_ENCODING_OPTION ‘FAST_DIFF’;
    cqd HBASE_COMPRESSION_OPTION ‘SNAPPY’;
    
    Add 
    cqd HBASE_MEMSTORE_FLUSH_SIZE_OPTION '1073741824' ;
    
    So one can use these values without explicitly specify them when create table.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/traflm/trafodion TRAFODION-3145

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafodion/pull/1646.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 #1646
    
----
commit 86fdb25c09785da8d17b05e38e4f802af97932e9
Author: Liu Ming <ov...@...>
Date:   2018-07-15T22:37:40Z

    [TRAFODION-3145] Make "hbase_options" as default setting and use cqd to change the default setting

----


---

[GitHub] trafodion pull request #1646: [TRAFODION-3145] Make "hbase_options" as defau...

Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1646#discussion_r202778388
  
    --- Diff: core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp ---
    @@ -10991,7 +10997,20 @@ CmpSeabaseDDL::setupHbaseOptions(ElemDDLHbaseOptions * hbaseOptionsClause,
               hbaseOptionsStr += optionStr;
             }
         }
    +  if (!flushSize.isNull() && !memstoreFlushSizeOptionSpecified)
    +    {
    +      hbaseOption = new(STMTHEAP) HbaseCreateOption("MEMSTORE_FLUSH_SIZE", 
    +                                                    flushSize.data());
    +      hbaseCreateOptions.insert(hbaseOption);
     
    +      if (ActiveSchemaDB()->getDefaults().userDefault
    +          (HBASE_MEMSTORE_FLUSH_SIZE_OPTION) == TRUE)
    +        {
    +          numHbaseOptions += 1;
    +          sprintf(optionStr, "MEMSTORE_FLUSH_SIZE='%s'|", flushSize.data());
    --- End diff --
    
    I would recommend using snprintf instead of sprintf, to avoid the possibility of a buffer overrun (probably not likely here, but just in case).
    
    ```
    snprintf(optionStr, sizeof(optionStr), ...)
    ```


---

[GitHub] trafodion pull request #1646: [TRAFODION-3145] Make "hbase_options" as defau...

Posted by traflm <gi...@git.apache.org>.
Github user traflm commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1646#discussion_r202908302
  
    --- Diff: core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp ---
    @@ -10991,7 +10997,20 @@ CmpSeabaseDDL::setupHbaseOptions(ElemDDLHbaseOptions * hbaseOptionsClause,
               hbaseOptionsStr += optionStr;
             }
         }
    +  if (!flushSize.isNull() && !memstoreFlushSizeOptionSpecified)
    +    {
    +      hbaseOption = new(STMTHEAP) HbaseCreateOption("MEMSTORE_FLUSH_SIZE", 
    +                                                    flushSize.data());
    +      hbaseCreateOptions.insert(hbaseOption);
     
    +      if (ActiveSchemaDB()->getDefaults().userDefault
    +          (HBASE_MEMSTORE_FLUSH_SIZE_OPTION) == TRUE)
    +        {
    +          numHbaseOptions += 1;
    +          sprintf(optionStr, "MEMSTORE_FLUSH_SIZE='%s'|", flushSize.data());
    --- End diff --
    
    I agree, I can change this into a more robust coding style, using snprintf.


---

[GitHub] trafodion pull request #1646: [TRAFODION-3145] Make "hbase_options" as defau...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/trafodion/pull/1646


---