tajo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eminency <...@git.apache.org>
Subject [GitHub] tajo pull request: TAJO-1465: Add ORCFileAppender to write into OR...
Date Tue, 01 Sep 2015 05:30:09 GMT
Github user eminency commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/652#discussion_r38386740
  
    --- Diff: tajo-common/src/main/java/org/apache/tajo/datum/DatumFactory.java ---
    @@ -114,45 +114,42 @@ public static Datum createFromString(DataType dataType, String value)
{
       public static Datum createFromBytes(DataType dataType, byte[] bytes) {
         switch (dataType.getType()) {
     
    -    case BOOLEAN:
    -      return createBool(bytes[0]);
    -    case INT2:
    -      return createInt2(NumberUtil.toShort(bytes));
    -    case INT4:
    -      return createInt4(NumberUtil.toInt(bytes));
    -    case INT8:
    -      return createInt8(NumberUtil.toLong(bytes));
    -    case FLOAT4:
    -      return createFloat4(NumberUtil.toFloat(bytes));
    -    case FLOAT8:
    -      return createFloat8(NumberUtil.toDouble(bytes));
    -    case CHAR:
    -      return createChar(bytes);
    -    case TEXT:
    -      return createText(bytes);
    -    case DATE:
    -      return new DateDatum(NumberUtil.toInt(bytes));
    -    case TIME:
    -      return new TimeDatum(NumberUtil.toLong(bytes));
    -    case TIMESTAMP:
    -      return new TimestampDatum(NumberUtil.toLong(bytes));
    -    case BIT:
    -      return createBit(bytes[0]);
    -    case BLOB:
    -      return createBlob(bytes);
    -    case INET4:
    -      return createInet4(bytes);
    -    case PROTOBUF:
    -      ProtobufDatumFactory factory = ProtobufDatumFactory.get(dataType);
    -      Message.Builder builder = factory.newBuilder();
    -      try {
    -        builder.mergeFrom(bytes);
    -        return factory.createDatum(builder.build());
    -      } catch (IOException e) {
    -        e.printStackTrace();
    -        throw new RuntimeException(e);
    -      }
    -    default:
    +      case BOOLEAN:
    +        return createBool(bytes[0]);
    +      case INT2:
    +        return createInt2(NumberUtil.toShort(bytes));
    +      case INT4:
    +        return createInt4(NumberUtil.toInt(bytes));
    +      case INT8:
    +        return createInt8(NumberUtil.toLong(bytes));
    +      case FLOAT4:
    +        return createFloat4(NumberUtil.toFloat(bytes));
    +      case FLOAT8:
    +        return createFloat8(NumberUtil.toDouble(bytes));
    +      case CHAR:
    +        return createChar(bytes);
    +      case TEXT:
    +        return createText(bytes);
    +      case DATE:
    +        return new DateDatum(NumberUtil.toInt(bytes));
    +      case TIME:
    +        return new TimeDatum(NumberUtil.toLong(bytes));
    +      case TIMESTAMP:
    +        return new TimestampDatum(NumberUtil.toLong(bytes));
    +      case BIT:
    +        return createBit(bytes[0]);
    +      case BLOB:
    +        return createBlob(bytes);
    +      case INET4:
    +        return createInet4(bytes);
    +      case PROTOBUF:
    +        try {
    +          return ProtobufDatumFactory.createDatum(dataType, bytes);
    +        } catch (IOException e) {
    +          e.printStackTrace();
    +          throw new RuntimeException(e);
    +        }
    +      default:
             throw new UnsupportedOperationException(dataType.toString());
    --- End diff --
    
    I see. I'm working on 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message