Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/257#discussion_r49619715
  
    --- Diff: core/sql/optimizer/SynthType.cpp ---
    @@ -5207,6 +5207,24 @@ const NAType *Translate::synthesizeType()
              err4106arg = SQLCHARSETSTRING_UTF8;
            break;
     
    +     case GBK_TO_UTF8:
    +       if (translateSource->getCharSet() == CharInfo::GBK )
    +         charsetTarget = CharInfo::UTF8;
    +       else
    +       {
    +           /* this is a solution to support GBK before Trafodion can 
support GBK in total
    +            * see jira 1720 for more details
    +            * the logic here is:
    +            * when HIVE_FILE_CHARSET is not empty, it means the real 
charset in Hive table is not same as HIVE_DEFAULT_CHARSET
    +            * in this case, allow the converting , ignoring the source 
charset checking above
    +            */
    +            if( CmpCommon::getDefaultString(HIVE_FILE_CHARSET) ==  "" ) 
//CmpCommon::getDefaultString(HIVE_DEFAULT_CHARSET) )
    --- End diff --
    
    See my other comment about where to put the automatic conversion. If you do 
that, this check will not be needed. Otherwise, this logic will now allow a 
TRANSLATE(GBKTOUTF8) anywhere in SQL statements. Allowing this just gives 
people an opportunity to shoot themselves in the foot, so it may be better to 
avoid it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to