Till Westmann has posted comments on this change. ( https://asterix-gerrit.ics.uci.edu/3360 )
Change subject: [WIP] Introduce data generator data source functions ...................................................................... Patch Set 6: (3 comments) https://asterix-gerrit.ics.uci.edu/#/c/3360/6/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/function/TPCDSDataGeneratorDatasource.java File asterixdb/asterix-app/src/main/java/org/apache/asterix/app/function/TPCDSDataGeneratorDatasource.java: https://asterix-gerrit.ics.uci.edu/#/c/3360/6/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/function/TPCDSDataGeneratorDatasource.java@30 PS6, Line 30: random Could we take the word "random" out again? It shouldn't be really random :) https://asterix-gerrit.ics.uci.edu/#/c/3360/6/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/function/TPCDSDataGeneratorReader.java File asterixdb/asterix-app/src/main/java/org/apache/asterix/app/function/TPCDSDataGeneratorReader.java: https://asterix-gerrit.ics.uci.edu/#/c/3360/6/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/function/TPCDSDataGeneratorReader.java@116 PS6, Line 116: IllegalArgumentException We should have a better error here. Providing a non-existing table name currently yields an internal error. (And let's add test case for that.) https://asterix-gerrit.ics.uci.edu/#/c/3360/6/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/function/TPCDSDataGeneratorRewriter.java File asterixdb/asterix-app/src/main/java/org/apache/asterix/app/function/TPCDSDataGeneratorRewriter.java: https://asterix-gerrit.ics.uci.edu/#/c/3360/6/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/function/TPCDSDataGeneratorRewriter.java@101 PS6, Line 101: private double getScalingFactor(AsterixConstantValue scalingFactorArgumentValue) throws TypeMismatchException { This should be equivalent (and much shorter): private double getScalingFactor(AsterixConstantValue scalingFactorArgumentValue) throws TypeMismatchException { switch (scalingFactorArgumentValue.getObject().getType().getTypeTag()) { case TINYINT: return ((AInt8) scalingFactorArgumentValue.getObject()).getByteValue(); case SMALLINT: return ((AInt16) scalingFactorArgumentValue.getObject()).getShortValue(); case INTEGER: return ((AInt32) scalingFactorArgumentValue.getObject()).getIntegerValue(); case BIGINT: return ((AInt64) scalingFactorArgumentValue.getObject()).getLongValue(); case FLOAT: return ((AFloat) scalingFactorArgumentValue.getObject()).getFloatValue(); case DOUBLE: return ((ADouble) scalingFactorArgumentValue.getObject()).getDoubleValue(); default: throw new TypeMismatchException(TPCDS_DATA_GENERATOR, 1, scalingFactorArgumentValue.getObject().getType().getTypeTag(), ATypeTag.TINYINT, ATypeTag.SMALLINT, ATypeTag.INTEGER, ATypeTag.BIGINT, ATypeTag.FLOAT, ATypeTag.DOUBLE); } } But I'm wondering if we already have such a utility function somewhere that we could reuse. -- To view, visit https://asterix-gerrit.ics.uci.edu/3360 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idb6bd6f697628395c70008e6f730bc5ca403da5e Gerrit-Change-Number: 3360 Gerrit-PatchSet: 6 Gerrit-Owner: Hussain Towaileb <[email protected]> Gerrit-Reviewer: Anon. E. Moose (1000171) Gerrit-Reviewer: Hussain Towaileb <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]> Gerrit-Comment-Date: Sun, 28 Apr 2019 06:30:42 +0000 Gerrit-HasComments: Yes
