Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Drill, mail # dev - Re: Review Request 17988: DRILL-366: Cast function from VarChar to BigInt produces wrong results


Copy link to this message
-
Re: Review Request 17988: DRILL-366: Cast function from VarChar to BigInt produces wrong results
Mehant Baid 2014-02-15, 12:11

This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/17988/

(Updated Feb. 15, 2014, 12:11 p.m.)
Review request for drill.
Summary (updated)

DRILL-366: Cast function from VarChar to BigInt produces wrong results
Repository: drill-git
Description

This patch resolves a minor issue in Casting from VarChar to BigInt.

Summary:
While casting VarChar to BigInt make sure the getByte() method is invoked with the appropriate byte offset.

CastFunctionsSrcVarLen.java:
Use in.start as starting index to invoke getBytes() instead of 0. We always end up with the same row when we use 0

TestCastVarCharToBigInt.java, *.json
Added a test case to read varchar and convert it to BigInt.
Diffs

  exec/java-exec/src/main/codegen/templates/CastFunctionsSrcVarLen.java 370597d
  exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestCastVarCharToBigInt.java PRE-CREATION
  exec/java-exec/src/test/resources/functions/cast/test_cast_varchar_to_bigint.json PRE-CREATION
  exec/java-exec/src/test/resources/scan_json_test_cast.json PRE-CREATION

Diff: https://reviews.apache.org/r/17988/diff/
Testing

Added unit test
Thanks,

Mehant Baid