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

    https://github.com/apache/incubator-trafodion/pull/257#discussion_r49682367
  
    --- 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 --
    
    totally agree. 
    I will add a test case, it will take some time to understand the test suite.
    And I will look at the codeGen, I didn't understand the whole path clearly. 
Yes, it is the right place to do the converting. My current change allow 
translate function to be used in unexpected cases, so, I will have another 
version asap. 
    Thanks for your patient review and guidance, it is very appreciated! There 
will be more commits in near future.


---
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