Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Nov 4, 2024
1 parent 2d2dbb5 commit 8d6cc0c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ public List<Rule> buildRules() {
&& ConnectContext.get().getSessionVariable().enableCompressMaterialize)
.then(this::compressedMaterializeAggregate)),
RuleType.COMPRESSED_MATERIALIZE_SORT.build(
logicalSort().then(this::compressMaterializeSort)
logicalSort().when(a -> ConnectContext.get() != null
&& ConnectContext.get().getSessionVariable().enableCompressMaterialize)
.then(this::compressMaterializeSort)
)
);
}
Expand Down Expand Up @@ -91,7 +93,7 @@ private Optional<Expression> getEncodeExpression(Expression expression) {
Expression encodeExpr = null;
if (type instanceof CharacterType) {
CharacterType ct = (CharacterType) type;
if (ct.getLen() > 1) {
if (ct.getLen() > 0) {
// skip column from variant, like 'L.var["L_SHIPMODE"] AS TEXT'
if (ct.getLen() < 2) {
encodeExpr = new EncodeAsSmallInt(expression);
Expand Down

0 comments on commit 8d6cc0c

Please sign in to comment.