trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsharma00 <...@git.apache.org>
Subject [GitHub] trafodion pull request #1502: various fixes, details in pull request
Date Thu, 05 Apr 2018 22:25:09 GMT
Github user anoopsharma00 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1502#discussion_r179617591
  
    --- Diff: core/sql/executor/ExExeUtilGet.cpp ---
    @@ -5795,40 +5833,51 @@ short ExExeUtilHiveMDaccessTcb::work()
                 str_cpy(infoCol->colName, 
                         (hcd ? hcd->name_ : hpd->name_), 256, ' ');
     
    -            infoCol->fsDatatype = 
    -              getFSTypeFromHiveColType(hcd ? hcd->type_ : hpd->type_);
    -
    -	    if (infoCol->fsDatatype < 0)
    +            Lng32 fstype = -1;
    +            Lng32 length = -1;
    +            Lng32 precision = -1;
    +            Lng32 scale = -1;
    +            char sqlType[50];
    +            char displayType[100];
    +            char charset[50];
    +            retcode = 
    +              getTypeAttrsFromHiveColType(hcd ? hcd->type_ : hpd->type_,
    +                                          htd->getSDs()->isOrcFile(),
    +                                          fstype, length, precision, scale,
    +                                          sqlType, displayType, charset);
    +                 
    +	    if (retcode < 0)
     	      {
    +                // add a warning and continue.
     		char strP[300];
    -		sprintf(strP, "Datatype %s is not supported.", 
    -                        (hcd ? hcd->type_ : hpd->type_));
    -		*diags << DgSqlCode(-CLI_GET_METADATA_INFO_ERROR)
    +		sprintf(strP, "Datatype %s for column '%s' in table %s.%s.%s is not supported. This
table will be ignored.", 
    +                        (hcd ? hcd->type_ : hpd->type_),
    +                        (hcd ? hcd->name_ : hpd->name_),
    +                        hiveCat_, hiveSch_, htd->tblName_);
    +		*diags << DgSqlCode(CLI_GET_METADATA_INFO_ERROR)
     		       << DgString0(strP);
    -		
    -		step_ = HANDLE_ERROR_;
    -		break;
    +
    +                step_ = ADVANCE_ROW_;
    --- End diff --
    
    If that error condition is reached, we dont return that row. It is skipped  and we move
    to the next row through step ADVANCE_ROW_.
    The warning is maintained in the diags area which is returned when the next row
    or EOD is returned.


---

Mime
View raw message