yanxinyi commented on a change in pull request #558: PHOENIX-5413: Fix union
all error when exists literal column type.
URL: https://github.com/apache/phoenix/pull/558#discussion_r310701796
##########
File path:
phoenix-core/src/test/java/org/apache/phoenix/compile/QueryCompilerTest.java
##########
@@ -2465,10 +2465,10 @@ public void testColumnProjectionUnionAll() throws
SQLException {
assertTrue(rowProj.getColumnProjector(1).getExpression().getMaxLength() == 20);
assertTrue(rowProj.getColumnProjector(2).getExpression().getDataType()
instanceof PVarchar);
-
assertTrue(rowProj.getColumnProjector(2).getExpression().getMaxLength() == 30);
+
assertTrue(rowProj.getColumnProjector(2).getExpression().getMaxLength() ==
null);
Review comment:
`/**
* @return the actual length of the column. For decimal, it would be its
precision. For char or
* varchar, it would be the maximum length as specified during schema
definition.
*/
`
`
Integer getMaxLength();
`
`
/**
* @return scale of a decimal number.
*/
`
`
Integer getScale();
`
If you look at the `getMaxLength` and `getScale` APIs, I'm not sure about
return `null` here. It might be better to change the logic and return the
actual number instead. @swaroopak any input?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services