----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/16738/ -----------------------------------------------------------
(Updated Jan. 30, 2014, 12:59 a.m.) Review request for drill. Changes ------- Incorporated the revised design changes for the decimal representation. Now we have the following holders and value vectors: Decimal9, Decimal18, Decimal28Dense, Decimal28Sparse, Decimal38Dense, Decimal38Sparse. We have the sparse representation for ease of performing arithmetic operations and the dense representation for performing comparison functions more efficiently. Have updated the short note on google docs with the design changes: https://docs.google.com/document/d/1koDaE4CviLWpKyfdNFQZ6PqkFbbwXC45lGtehcihVmQ/edit?usp=sharing DecimalCastFunctions.java This class is a template that is used by free marker to generate various cast functions between the 6 different representations of decimal. At this point only casting up is supported (eg: going from Decimal9 to Decimal18 is supported and not the other way round) DecimalFunctions.java This class contains templates for arithmetic and comparison functions which will be used by free marker to generate the corresponding functions for each decimal representation. DecimalUtility.java Contains some basic constants and functions used while performing decimal casting and arithmetic operations. FixedValueVectors.java, NullValueVectors.java, ValueHolders.java Added logic to generate the corresponding value vectors and holders for all the decimal representation Repository: drill-git Description ------- This patch contains the barebones for supporting decimal type. It contains modifications to template files and tdd to generate the Holder and Vector representation for Decimal type (Decimal4, Decimal8, Decimal12, Decimal16). For ease of review, I've added a couple of generated classes Decimal16Holder, Decimal16Vector here. Since these are compile time generated classes it wouldn't show up in reality. I'd like to get some feedback on the holder and vector representation (Decimal16Holder, Decimal16Vector). The Decimal16Vector class is pretty much like most vector representation since its generated using codegen, the get(), set() methods are the ones that are different. Here is a link to a design note that talks about the representation used for decimal type: https://docs.google.com/document/d/1koDaE4CviLWpKyfdNFQZ6PqkFbbwXC45lGtehcihVmQ/edit?usp=sharing Diffs (updated) ----- common/src/main/java/org/apache/drill/common/types/Types.java efb7bf4 exec/java-exec/src/main/codegen/config.fmpp cd2b2cc exec/java-exec/src/main/codegen/data/Casts.tdd ceb9cde exec/java-exec/src/main/codegen/data/DecimalTypes.tdd PRE-CREATION exec/java-exec/src/main/codegen/data/ValueVectorTypes.tdd 88a5974 exec/java-exec/src/main/codegen/templates/DecimalCastFunctions.java PRE-CREATION exec/java-exec/src/main/codegen/templates/DecimalFunctions.java PRE-CREATION exec/java-exec/src/main/codegen/templates/FixedValueVectors.java c357dd6 exec/java-exec/src/main/codegen/templates/NullableValueVectors.java 051c62d exec/java-exec/src/main/codegen/templates/ValueHolders.java 41dc049 exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/DecimalUtility.java PRE-CREATION exec/java-exec/src/main/java/org/apache/drill/exec/resolver/ResolverTypePrecedence.java 26ac961 exec/java-exec/src/main/java/org/apache/drill/exec/resolver/TypeCastRules.java b16d1ff protocol/src/main/java/org/apache/drill/common/types/TypeProtos.java e4fd94a protocol/src/main/protobuf/Types.proto 3434110 Diff: https://reviews.apache.org/r/16738/diff/ Testing ------- Thanks, Mehant Baid
