Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
Fix compiler warnings introduced by patches for issues CALCITE-3031 and
CALCITE-3187.
Also force compiler to stop if such warnings are detected.
  • Loading branch information
laurentgo committed Jul 31, 2019
1 parent d98856b commit fef2133
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,8 @@ private RexNode expandTimes(RexCall call, List<RexNode> operands) {
// a lower scale, then the number should be scaled down.
int divisor = scaleA + scaleB - call.getType().getScale();

if (builder.getTypeFactory().useDoubleMultiplication(
if (builder.getTypeFactory().getTypeSystem().shouldUseDoubleMultiplication(
builder.getTypeFactory(),
typeA,
typeB)) {
// Approximate implementation:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.apache.calcite.sql.SqlKind;
import org.apache.calcite.sql.fun.SqlQuantifyOperator;
import org.apache.calcite.sql.fun.SqlStdOperatorTable;
import org.apache.calcite.sql.type.SqlTypeName;
import org.apache.calcite.sql2rel.RelDecorrelator;
import org.apache.calcite.tools.RelBuilder;
import org.apache.calcite.tools.RelBuilderFactory;
Expand Down Expand Up @@ -198,7 +197,7 @@ private RexNode rewriteSome(RexSubQuery e, Set<CorrelationId> variablesSet,
builder.field("q", "m"))), builder.literal(true), builder
.call(SqlStdOperatorTable.GREATER_THAN, builder.field("q", "c"),
builder.field("q", "d")),
e.rel.getCluster().getRexBuilder().makeNullLiteral(SqlTypeName.BOOLEAN), builder
builder.getRexBuilder().constantNull(), builder
.call(RelOptUtil.op(op.comparisonKind, null), e.operands.get(0),
builder.field("q", "m")));
} else {
Expand Down Expand Up @@ -241,7 +240,7 @@ private RexNode rewriteSome(RexSubQuery e, Set<CorrelationId> variablesSet,
builder.field("q", "m"))), builder.literal(true), builder
.call(SqlStdOperatorTable.GREATER_THAN, builder.field("q", "c"),
builder.field("q", "d")),
e.rel.getCluster().getRexBuilder().makeNullLiteral(SqlTypeName.BOOLEAN), builder
builder.getRexBuilder().constantNull(), builder
.call(RelOptUtil.op(op.comparisonKind, null), e.operands.get(0),
builder.field("q", "m")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ private List<RelDataTypeFieldImpl> fieldsOf(Class clazz) {
* {@link RelDataTypeSystem#deriveDecimalMultiplyType(RelDataTypeFactory, RelDataType, RelDataType)}
* to get the return type for the operation.
*/
@Deprecated
public RelDataType createDecimalProduct(
RelDataType type1,
RelDataType type2) {
Expand All @@ -471,6 +472,7 @@ public RelDataType createDecimalProduct(
* {@link RelDataTypeSystem#shouldUseDoubleMultiplication(RelDataTypeFactory, RelDataType, RelDataType)}
* to get if double should be used for multiplication.
*/
@Deprecated
public boolean useDoubleMultiplication(
RelDataType type1,
RelDataType type2) {
Expand All @@ -482,6 +484,7 @@ public boolean useDoubleMultiplication(
* {@link RelDataTypeSystem#deriveDecimalDivideType(RelDataTypeFactory, RelDataType, RelDataType)}
* to get the return type for the operation.
*/
@Deprecated
public RelDataType createDecimalQuotient(
RelDataType type1,
RelDataType type2) {
Expand Down
5 changes: 4 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,10 @@ limitations under the License.
<!-- If you are looking to change source/target,
change the maven.compiler.{source,target} property -->
<configuration>
<compilerArgument>-Xlint:deprecation</compilerArgument>
<compilerArgs>
<arg>-Xlint:deprecation</arg>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit fef2133

Please sign in to comment.