[
https://issues.apache.org/jira/browse/PHOENIX-5432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17041542#comment-17041542
]
Hadoop QA commented on PHOENIX-5432:
------------------------------------
{color:red}-1 overall{color}. Here are the results of testing the latest
attachment
http://issues.apache.org/jira/secure/attachment/12994053/PHOENIX-5432.master.v14.patch
against master branch at commit 28de55b5c79a5fc32dee97a59e5b4f528ca6dce6.
ATTACHMENT ID: 12994053
{color:green}+1 @author{color}. The patch does not contain any @author
tags.
{color:green}+1 tests included{color}. The patch appears to include 130
new or modified tests.
{color:green}+1 javac{color}. The applied patch does not increase the
total number of javac compiler warnings.
{color:green}+1 release audit{color}. The applied patch does not increase
the total number of release audit warnings.
{color:red}-1 lineLengths{color}. The patch introduces the following lines
longer than 100:
+ dv == null ? null : new
LiteralExpression.Builder().setValue(((LiteralParseNode)dv).getValue()).buildSimple(false),
+ minv == null ? null : new
LiteralExpression.Builder().setValue(((LiteralParseNode)minv).getValue()).buildSimple(false),
+ maxv == null ? null : new
LiteralExpression.Builder().setValue(((LiteralParseNode)maxv).getValue()).buildSimple(false));})
+ return new
LiteralExpression.Builder().setValue(false).setDeterminism(determinism).buildSimple(false);
+ return new
LiteralExpression.Builder().setValue(value).setDeterminism(Determinism.ALWAYS).buildSimple(false);
+ return new
LiteralExpression.Builder().setValue(node.getValue()).setDataType(node.getType()).setDeterminism(Determinism.ALWAYS).build();
+ return new
LiteralExpression.Builder().setDataType(PBoolean.INSTANCE).setDeterminism(rhs.getDeterminism()).build();
+ return new
LiteralExpression.Builder().setValue(false).setDeterminism(rhs.getDeterminism()).buildSimple(false);
+ rhs = new
LiteralExpression.Builder().setValue(rhsLiteral).setDataType(PChar.INSTANCE)
+
.toObject(KeyRange.IS_NOT_NULL_RANGE.getLowerRange())).buildSimple(false));
{color:green}+1 core tests{color}. The patch passed unit tests in .
Test results:
https://builds.apache.org/job/PreCommit-PHOENIX-Build/3470//testReport/
Console output:
https://builds.apache.org/job/PreCommit-PHOENIX-Build/3470//console
This message is automatically generated.
> Refactor LiteralExpression to use the builder pattern
> -----------------------------------------------------
>
> Key: PHOENIX-5432
> URL: https://issues.apache.org/jira/browse/PHOENIX-5432
> Project: Phoenix
> Issue Type: Improvement
> Affects Versions: 4.15.0, 5.1.0
> Reporter: Chinmay Kulkarni
> Assignee: Christine Feng
> Priority: Major
> Attachments: PHOENIX-5432-master-v1.patch,
> PHOENIX-5432.master.v10.patch, PHOENIX-5432.master.v11.patch,
> PHOENIX-5432.master.v12.patch, PHOENIX-5432.master.v13.patch,
> PHOENIX-5432.master.v14.patch, PHOENIX-5432.master.v2.patch,
> PHOENIX-5432.master.v3.patch, PHOENIX-5432.master.v4.patch,
> PHOENIX-5432.master.v5.patch, PHOENIX-5432.master.v6.patch,
> PHOENIX-5432.master.v7.patch, PHOENIX-5432.master.v8.patch,
> PHOENIX-5432.master.v9.patch, PHOENIX-5432.patch
>
> Time Spent: 6h 20m
> Remaining Estimate: 0h
>
> LiteralExpression is a mess. While it provides newConstant() APIs to build
> the object, it also provides two public constructors. There are 10 overloaded
> newConstant() methods and it is unclear which API to use in which case.
> This should be refactored to use the builder pattern and final member
> variables. Ideally, getters such as getMaxLength() should be simple member
> variable accessors and other ad-hoc logic surrounding those variables should
> be handled correctly when setting their respective values.
>
> Two solutions:
> # Consolidate the LiteralExpression newConstant() methods down into a single
> build() method
> ** Pros: easy to use since one build method can create all LiteralExpression
> objects
> ** Cons: requires adding 'throws SQLException' to a lot of method signatures
> where it wasn't necessary before, which can be confusing for future
> developers and potentially cause problems if a SQLException is actually
> thrown in some of these cases
> # Create two build() methods - one for LiteralExpressions that necessitate
> deriving value (which could throw SQLExceptions) and ones that don't
> ** Pros: don't need to change any existing method signatures
> ** Cons: requires future developers to know which of the two build methods
> to use
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)