Skip to content

Commit

Permalink
Conditions and formulas applied to blink tables should be allowed to …
Browse files Browse the repository at this point in the history
…use i, ii, k, and column arrays.
  • Loading branch information
rcaudy committed Mar 4, 2024
1 parent f3e620a commit 05b17ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ public void validateSafeForRefresh(BaseTable<?> sourceTable) {
}
if (sourceTable.isRefreshing() && !AbstractFormulaColumn.ALLOW_UNSAFE_REFRESHING_FORMULAS) {
// note that constant offset array accesss does not use i/ii or end up in usedColumnArrays
boolean isUnsafe = !sourceTable.isAppendOnly() && (usesI || usesII);
isUnsafe |= !sourceTable.isAddOnly() && usesK;
isUnsafe |= !usedColumnArrays.isEmpty();
boolean isUnsafe = (usesI || usesII) && !sourceTable.isAppendOnly() && !sourceTable.isBlink();
isUnsafe |= usesK && !sourceTable.isAddOnly() && !sourceTable.isBlink();
isUnsafe |= !usedColumnArrays.isEmpty() && !sourceTable.isBlink();
if (isUnsafe) {
throw new IllegalArgumentException("Formula '" + formula + "' uses i, ii, k, or column array " +
"variables, and is not safe to refresh. Note that some usages, such as on an append-only " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ public void validateSafeForRefresh(BaseTable<?> sourceTable) {
}
if (sourceTable.isRefreshing() && !ALLOW_UNSAFE_REFRESHING_FORMULAS) {
// note that constant offset array accesss does not use i/ii or end up in usedColumnArrays
boolean isUnsafe = !sourceTable.isAppendOnly() && (usesI || usesII);
isUnsafe |= !sourceTable.isAddOnly() && usesK;
isUnsafe |= !usedColumnArrays.isEmpty();
boolean isUnsafe = (usesI || usesII) && !sourceTable.isAppendOnly() && !sourceTable.isBlink();
isUnsafe |= usesK && !sourceTable.isAddOnly() && !sourceTable.isBlink();
isUnsafe |= !usedColumnArrays.isEmpty() && !sourceTable.isBlink();
if (isUnsafe) {
throw new IllegalArgumentException("Formula '" + formulaString + "' uses i, ii, k, or column array " +
"variables, and is not safe to refresh. Note that some usages, such as on an append-only " +
Expand Down

0 comments on commit 05b17ec

Please sign in to comment.