julianhyde commented on code in PR #3360:
URL: https://github.com/apache/calcite/pull/3360#discussion_r1290560592
##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -1104,6 +1104,16 @@ private SqlNode validateScopedExpression(
List<SqlNode> operands = ((SqlCall) node).getOperandList();
SqlSampleSpec sampleSpec = SqlLiteral.sampleValue(operands.get(1));
if (sampleSpec instanceof SqlSampleSpec.SqlTableSampleSpec) {
+ // The sampling percentage is between 0(0%) and 1(100%),1 is exclusive
+ float samplePercentage =
Review Comment:
Not your fault, but it seems foolish to convert samplePercentag to a `float`
and then back to a `BigDecimal`.
Let's keep it as a `BigDecimal`. Can you change the type of field
`SqlTableSampleSpec.samplePercentage` from `float` to `BigDecimal`, and make it
public. The method `getSamplePercentage()` should remain `float` but is
deprecated.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]