-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Add timestamp() KQL filter pushdown; sync DeprecatedDateString rename with clp-s upstream.
#148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add timestamp() KQL filter pushdown; sync DeprecatedDateString rename with clp-s upstream.
#148
Changes from all commits
4aab91f
8d6a12e
8e9b126
b17fd55
4e09a80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
| import com.facebook.presto.SystemSessionProperties; | ||
| import com.facebook.presto.common.block.BlockEncodingManager; | ||
| import com.facebook.presto.common.type.RowType; | ||
| import com.facebook.presto.common.type.TimeZoneKey; | ||
| import com.facebook.presto.common.type.Type; | ||
| import com.facebook.presto.metadata.AnalyzePropertyManager; | ||
| import com.facebook.presto.metadata.CatalogManager; | ||
|
|
@@ -52,6 +53,7 @@ | |
| import static com.facebook.presto.common.type.BigintType.BIGINT; | ||
| import static com.facebook.presto.common.type.BooleanType.BOOLEAN; | ||
| import static com.facebook.presto.common.type.DoubleType.DOUBLE; | ||
| import static com.facebook.presto.common.type.TimestampType.TIMESTAMP; | ||
| import static com.facebook.presto.common.type.VarcharType.VARCHAR; | ||
| import static com.facebook.presto.metadata.FunctionAndTypeManager.createTestFunctionAndTypeManager; | ||
| import static com.facebook.presto.metadata.SessionPropertyManager.createTestingSessionPropertyManager; | ||
|
|
@@ -91,8 +93,9 @@ public class TestClpQueryBase | |
| RowType.field("Name", VARCHAR))))))); | ||
| protected static final ClpColumnHandle fare = new ClpColumnHandle("fare", DOUBLE); | ||
| protected static final ClpColumnHandle isHoliday = new ClpColumnHandle("isHoliday", BOOLEAN); | ||
| protected static final ClpColumnHandle clpTimestamp = new ClpColumnHandle("clpTimestamp", TIMESTAMP); | ||
| protected static final Map<VariableReferenceExpression, ColumnHandle> variableToColumnHandleMap = | ||
| Stream.of(city, fare, isHoliday) | ||
| Stream.of(city, fare, isHoliday, clpTimestamp) | ||
| .collect(toMap( | ||
| ch -> new VariableReferenceExpression(Optional.empty(), ch.getColumnName(), ch.getColumnType()), | ||
| ch -> ch)); | ||
|
|
@@ -133,6 +136,21 @@ public SessionHolder() | |
| session = TestingSession.testSessionBuilder(createTestingSessionPropertyManager(new SystemSessionProperties().getSessionProperties())).build(); | ||
| } | ||
|
|
||
| /** | ||
| * Creates a session with a fixed timezone. Use this when tests assert against hardcoded | ||
| * epoch-ms values derived from timestamp literals (e.g., {@code TIMESTAMP '2023-01-01 | ||
| * 00:00:00.000'}), since Presto parses timestamp literals relative to the session timezone. | ||
| * Without pinning the timezone, the same literal produces different epoch-ms values on | ||
| * machines in different timezones, causing the assertions to fail. | ||
| */ | ||
| public SessionHolder(TimeZoneKey timeZoneKey) | ||
| { | ||
| connectorSession = SESSION; | ||
| session = TestingSession.testSessionBuilder(createTestingSessionPropertyManager(new SystemSessionProperties().getSessionProperties())) | ||
| .setTimeZoneKey(timeZoneKey) | ||
| .build(); | ||
|
Comment on lines
+148
to
+151
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# First, let's find and read the file to understand the context
fd -e java "TestClpQueryBase.java" -x cat -n {}Repository: y-scope/presto Length of output: 1694 🌐 Web query:
💡 Result: In PrestoDB (server-side,
Sources: 🌐 Web query:
💡 Result: In Presto connector code, the session time zone is not a generic
How it gets set (what drives
Related SQL-side visibility:
Sources: 🌐 Web query:
💡 Result:
So the only reliable ways to know the “default timezone” are to inspect the actual TimeZoneKey tz = TestingConnectorSession.SESSION.getTimeZoneKey();More generally (outside this test helper), Presto’s session time zone typically comes from the client, and if not available, from the coordinator/server. [2] Sources: 🌐 Web query:
💡 Result: In Presto,
So the effective propagation path is:
Sources Citations:
Align The Replace 🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| public ConnectorSession getConnectorSession() | ||
| { | ||
| return connectorSession; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.