forked from trinodb/trino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- implemented pushdown expression rewriters - implemented aggregation function rewriters - reformat code - fixed jdbc splitting bug
- Loading branch information
1 parent
41932c6
commit 7bb5957
Showing
47 changed files
with
1,569 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
175 changes: 175 additions & 0 deletions
175
plugin/trino-adb/src/main/java/io/trino/plugin/adb/connector/AdbPushdownConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.trino.plugin.adb.connector; | ||
|
||
import io.airlift.configuration.Config; | ||
import io.airlift.configuration.ConfigDescription; | ||
|
||
public class AdbPushdownConfig | ||
{ | ||
private boolean pushdownLiterals = true; | ||
private boolean pushdownDecimalArithmetics = true; | ||
private boolean pushdownDoubleArithmetics = true; | ||
private boolean pushdownDatetimeArithmetics = true; | ||
private boolean pushdownDatetimeComparison = true; | ||
private boolean pushdownFunctionCast = true; | ||
private boolean pushdownFunctionDatePart = true; | ||
private boolean pushdownFunctionLike = true; | ||
private boolean pushdownFunctionSubstring = true; | ||
private boolean pushdownFunctionUpper = true; | ||
private boolean pushdownFunctionLower = true; | ||
|
||
public boolean isPushdownLiterals() | ||
{ | ||
return this.pushdownLiterals; | ||
} | ||
|
||
@Config("adb.pushdown.literals") | ||
@ConfigDescription("Whether to pushdown BOOLEAN, CHAR, REAL and DOUBLE literals, as well as literals with NULL values") | ||
public AdbPushdownConfig setPushdownLiterals(boolean pushdownLiterals) | ||
{ | ||
this.pushdownLiterals = pushdownLiterals; | ||
return this; | ||
} | ||
|
||
public boolean isPushdownDecimalArithmetics() | ||
{ | ||
return this.pushdownDecimalArithmetics; | ||
} | ||
|
||
@Config("adb.pushdown.decimal-arithmetics") | ||
@ConfigDescription("Whether to pushdown arithmetical operations on DECIMAL data type") | ||
public AdbPushdownConfig setPushdownDecimalArithmetics(boolean pushdownDecimalArithmetics) | ||
{ | ||
this.pushdownDecimalArithmetics = pushdownDecimalArithmetics; | ||
return this; | ||
} | ||
|
||
public boolean isPushdownDoubleArithmetics() | ||
{ | ||
return this.pushdownDoubleArithmetics; | ||
} | ||
|
||
@Config("adb.pushdown.double-arithmetics") | ||
@ConfigDescription("Whether to pushdown arithmetical operations on REAL and DOUBLE data types") | ||
public AdbPushdownConfig setPushdownDoubleArithmetics(boolean pushdownDoubleArithmetics) | ||
{ | ||
this.pushdownDoubleArithmetics = pushdownDoubleArithmetics; | ||
return this; | ||
} | ||
|
||
public boolean isPushdownDatetimeArithmetics() | ||
{ | ||
return this.pushdownDatetimeArithmetics; | ||
} | ||
|
||
@Config("adb.pushdown.datetime-arithmetics") | ||
@ConfigDescription("Whether to pushdown arithmetical operations on date/time data types") | ||
public AdbPushdownConfig setPushdownDatetimeArithmetics(boolean pushdownDatetimeArithmetics) | ||
{ | ||
this.pushdownDatetimeArithmetics = pushdownDatetimeArithmetics; | ||
return this; | ||
} | ||
|
||
public boolean isPushdownDatetimeComparison() | ||
{ | ||
return this.pushdownDatetimeComparison; | ||
} | ||
|
||
@Config("adb.pushdown.datetime-comparison") | ||
@ConfigDescription("Whether to pushdown comparison operations on date/time data types") | ||
public AdbPushdownConfig setPushdownDatetimeComparison(boolean pushdownDatetimeComparison) | ||
{ | ||
this.pushdownDatetimeComparison = pushdownDatetimeComparison; | ||
return this; | ||
} | ||
|
||
public boolean isPushdownFunctionCast() | ||
{ | ||
return this.pushdownFunctionCast; | ||
} | ||
|
||
@Config("adb.pushdown.function.cast") | ||
@ConfigDescription("Whether to pushdown CAST function") | ||
public AdbPushdownConfig setPushdownFunctionCast(boolean pushdownFunctionCast) | ||
{ | ||
this.pushdownFunctionCast = pushdownFunctionCast; | ||
return this; | ||
} | ||
|
||
public boolean isPushdownFunctionDatePart() | ||
{ | ||
return this.pushdownFunctionDatePart; | ||
} | ||
|
||
@Config("adb.pushdown.function.date-part") | ||
@ConfigDescription("Whether to pushdown DATE_PART functions") | ||
public AdbPushdownConfig setPushdownFunctionDatePart(boolean pushdownFunctionDatePart) | ||
{ | ||
this.pushdownFunctionDatePart = pushdownFunctionDatePart; | ||
return this; | ||
} | ||
|
||
public boolean isPushdownFunctionLike() | ||
{ | ||
return this.pushdownFunctionLike; | ||
} | ||
|
||
@Config("adb.pushdown.function.like") | ||
@ConfigDescription("Whether to pushdown LIKE function") | ||
public AdbPushdownConfig setPushdownFunctionLike(boolean pushdownFunctionLike) | ||
{ | ||
this.pushdownFunctionLike = pushdownFunctionLike; | ||
return this; | ||
} | ||
|
||
public boolean isPushdownFunctionSubstring() | ||
{ | ||
return this.pushdownFunctionSubstring; | ||
} | ||
|
||
@Config("adb.pushdown.function.substring") | ||
@ConfigDescription("Whether to pushdown SUBSTRING function") | ||
public AdbPushdownConfig setPushdownFunctionSubstring(boolean pushdownFunctionSubstring) | ||
{ | ||
this.pushdownFunctionSubstring = pushdownFunctionSubstring; | ||
return this; | ||
} | ||
|
||
public boolean isPushdownFunctionUpper() | ||
{ | ||
return this.pushdownFunctionUpper; | ||
} | ||
|
||
@Config("adb.pushdown.function.upper") | ||
@ConfigDescription("Whether to pushdown UPPER function") | ||
public AdbPushdownConfig setPushdownFunctionUpper(boolean pushdownFunctionUpper) | ||
{ | ||
this.pushdownFunctionUpper = pushdownFunctionUpper; | ||
return this; | ||
} | ||
|
||
public boolean isPushdownFunctionLower() | ||
{ | ||
return this.pushdownFunctionLower; | ||
} | ||
|
||
@Config("adb.pushdown.function.lower") | ||
@ConfigDescription("Whether to pushdown LOWER function") | ||
public AdbPushdownConfig setPushdownFunctionLower(boolean pushdownFunctionLower) | ||
{ | ||
this.pushdownFunctionLower = pushdownFunctionLower; | ||
return this; | ||
} | ||
} |
Oops, something went wrong.