[
https://issues.apache.org/jira/browse/TRAFODION-2119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15414487#comment-15414487
]
ASF GitHub Bot commented on TRAFODION-2119:
-------------------------------------------
Github user traflm commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/642#discussion_r74167537
--- Diff: core/sql/optimizer/EncodedKeyValue.cpp ---
@@ -68,14 +68,22 @@ NAString * getMinMaxValue(TrafDesc * column,
return NULL;
Lng32 buflen = type->getTotalSize();
+ Lng32 nullHdrSize = 0;
char * buf = new char[buflen]; // deleted at the end of this method
-
+ if (type->supportsSQLnullPhysical())
+ {
+ nullHdrSize = type->getSQLnullHdrSize();
+ for(int i = 0; i < nullHdrSize; i++)
--- End diff --
there are two issues to use memset() here, please keep in mind the
nullHdrSize will be 2 or 4
1. memset is good for large buffer initialization, because it will try to
do 8 bytes copy in parallel and in memory alignment, but for small buffer , it
is same as a while loop. memset() . It will also try to adjust memory
alignment, which is useless for 2 or 4 bytes initialization, but just waste a
few CPU cycle.
2. memset will require a function call.
And the most important: this is DDL, which performance of this kind of
issue is not my concern.
> create table report strange WARNING when using store by and
> allow_nullable_unique_key_constraint CQD
> ----------------------------------------------------------------------------------------------------
>
> Key: TRAFODION-2119
> URL: https://issues.apache.org/jira/browse/TRAFODION-2119
> Project: Apache Trafodion
> Issue Type: Bug
> Reporter: liu ming
> Assignee: liu ming
>
> cqd allow_nullable_unique_key_constraint 'on' ;
> create table T_RH_DZSP
> (
> s_orgcode CHAR(12) character set utf8,
> s_applydate CHAR(8) character set utf8,
> s_packno varchar(8) character set utf8,
> s_trecode CHAR(10) character set utf8,
> s_trename varchar(60) character set utf8,
> s_taxorgcode varchar(12) character set utf8,
> s_paybnkno varchar(12) character set utf8,
> s_trano varchar(8) character set utf8,
> s_orimsgno CHAR(4) character set utf8,
> f_traamt numeric(18,2),
> s_payeropnbnkno varchar(12) character set utf8,
> payeropbkname varchar(60) character set utf8,
> s_handorgname varchar(200) character set utf8,
> s_payacct varchar(32) character set utf8,
> s_taxvouno varchar(20) character set utf8,
> s_billdate CHAR(8) character set utf8,
> s_taxpaycode varchar(20) character set utf8,
> s_taxpayname varchar(200) character set utf8,
> c_budgettype CHAR(1) character set utf8,
> c_trimflag CHAR(1) character set utf8,
> s_etpcode varchar(20) character set utf8,
> s_etpname varchar(200) character set utf8,
> s_etptype varchar(20) character set utf8,
> s_bdgsbtcode varchar(30) character set utf8,
> s_bdgsbtname varchar(60) character set utf8,
> s_limit CHAR(8) character set utf8,
> s_taxtypecode CHAR(10) character set utf8,
> s_taxkindname varchar(60) character set utf8,
> c_bdglevel CHAR(1) character set utf8,
> c_bdglevelname varchar(60) character set utf8,
> s_taxstartdate CHAR(8) character set utf8,
> s_taxenddate CHAR(8) character set utf8,
> s_astflag varchar(35) character set utf8,
> c_taxtype CHAR(1) character set utf8,
> s_acct CHAR(8) character set utf8,
> s_trastate CHAR(2) character set utf8,
> s_remark varchar(60) character set utf8,
> s_remark1 varchar(60) character set utf8,
> s_remark2 varchar(60) character set utf8,
> s_inputerid varchar(18) character set utf8,
> ts_sysupdate varchar(100) character set utf8,
> s_seq varchar(100) character set utf8
> )
> store by (S_APPLYDATE)
> salt using 48 partitions on (S_APPLYDATE)
> ATTRIBUTES ALIGNED FORMAT
> HBASE_OPTIONS
> (
> DATA_BLOCK_ENCODING = 'FAST_DIFF',
> -- COMPRESSION = 'SNAPPY',
> MEMSTORE_FLUSH_SIZE = '1073741824'
> );
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> *** WARNING[8402] A string overflow occurred during the evaluation of a
> character expression.
> --- SQL operation complete.
> >>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)