Skip to content

Commit

Permalink
Added version check on decimal type mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrapohl committed Sep 9, 2015
1 parent 94f65c4 commit 972ac08
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -36,6 +36,8 @@
public class ImpalaExecutionFactory extends BaseHiveExecutionFactory {

public static String IMPALA = "impala"; //$NON-NLS-1$
public static final Version ONE_4 = Version.getVersion("1.4"); //$NON-NLS-1$
public static final Version TWO_0 = Version.getVersion("2.0"); //$NON-NLS-1$

@Override
public void start() throws TranslatorException {
Expand All @@ -50,10 +52,11 @@ public void start() throws TranslatorException {
convert.addTypeMapping("float", FunctionModifier.FLOAT); //$NON-NLS-1$
convert.addTypeMapping("string", FunctionModifier.STRING); //$NON-NLS-1$
convert.addTypeMapping("timestamp", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
convert.addTypeMapping("decimal", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
if (getVersion().compareTo(TWO_0) >= 0) {
convert.addTypeMapping("decimal", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
}

registerFunctionModifier(SourceSystemFunctions.CONVERT, convert);

registerFunctionModifier(SourceSystemFunctions.LCASE, new AliasModifier("lower")); //$NON-NLS-1$
registerFunctionModifier(SourceSystemFunctions.UCASE, new AliasModifier("upper")); //$NON-NLS-1$
registerFunctionModifier(SourceSystemFunctions.SUBSTRING, new AliasModifier("substr")); //$NON-NLS-1$
Expand Down

0 comments on commit 972ac08

Please sign in to comment.