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

    https://github.com/apache/tajo/pull/819#discussion_r45174985
  
    --- Diff: 
tajo-plan/src/main/java/org/apache/tajo/plan/util/EvalNodeToExprConverter.java 
---
    @@ -178,65 +204,28 @@ protected EvalNode visitConst(Object o, ConstEval 
evalNode, Stack<EvalNode> stac
     
             break;
           case TIMESTAMP:
    -        TimestampDatum timestampDatum = (TimestampDatum) 
evalNode.getValue();
    +        TimestampDatum timestampDatum = (TimestampDatum) datum;
     
             dateValue = new DateValue(""+timestampDatum.getYear(),
               ""+timestampDatum.getMonthOfYear(), 
""+timestampDatum.getDayOfMonth());
     
             timeValue = new TimeValue(""+timestampDatum.getHourOfDay()
    -        , ""+timestampDatum.getMinuteOfHour(), 
""+timestampDatum.getSecondOfMinute());
    +          , ""+timestampDatum.getMinuteOfHour(), 
""+timestampDatum.getSecondOfMinute());
     
             value = new TimestampLiteral(dateValue, timeValue);
             break;
           case TIME:
    -        TimeDatum timeDatum = (TimeDatum) evalNode.getValue();
    +        TimeDatum timeDatum = (TimeDatum) datum;
             timeValue = new TimeValue(""+timeDatum.getHourOfDay()
               , ""+timeDatum.getMinuteOfHour(), 
""+timeDatum.getSecondOfMinute());
     
             value = new TimeLiteral(timeValue);
             break;
           default:
    -        throw new RuntimeException("Unsupported type: " + 
evalNode.getValueType().getType().name());
    -    }
    -    exprs.push(value);
    -
    -    return super.visitConst(o, evalNode, stack);
    -  }
    -
    -  @Override
    -  protected EvalNode visitRowConstant(Object o, RowConstantEval evalNode, 
Stack<EvalNode> stack) {
    -    Expr[] values = new Expr[evalNode.getValues().length];
    -    for (int i = 0; i < evalNode.getValues().length; i++) {
    -      Datum datum = evalNode.getValues()[i];
    -      LiteralValue value;
    -      switch (datum.type()) {
    -        case BOOLEAN:
    -          value = new LiteralValue(datum.asChars(), 
LiteralValue.LiteralType.Boolean);
    -          break;
    -        case TEXT:
    -          value = new LiteralValue(datum.asChars(), 
LiteralValue.LiteralType.String);
    -          break;
    -        case INT1:
    -        case INT2:
    -        case INT4:
    -          value = new LiteralValue(datum.asChars(), 
LiteralValue.LiteralType.Unsigned_Integer);
    -          break;
    -        case INT8:
    -          value = new LiteralValue(datum.asChars(), 
LiteralValue.LiteralType.Unsigned_Large_Integer);
    -          break;
    -        case FLOAT4:
    -        case FLOAT8:
    -          value = new LiteralValue(datum.asChars(), 
LiteralValue.LiteralType.Unsigned_Float);
    -          break;
    -        default:
    -          throw new RuntimeException("Unsupported type: " + 
datum.type().name());
    -      }
    -      values[i] = value;
    +        throw new RuntimeException("Unsupported type: " + type.name());
    --- End diff --
    
    TajoInternalError means an unrecoverable error is occured and at least the 
current running query must be stopped. It won't be what we intend here.
    Instead, you can simply wrap UnsupportedException with RuntimeException. 


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