Skip to content
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

fix(compiler-internals): define unsupported operations after simple operations #9755

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore(risingwave): move first/last to visit methods
cpcloud committed Aug 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 408e18c2e3b8bd160887e2c261dc2e72abdeb498
11 changes: 6 additions & 5 deletions ibis/backends/sql/compilers/risingwave.py
Original file line number Diff line number Diff line change
@@ -32,11 +32,6 @@ class RisingWaveCompiler(PostgresCompiler):
),
)

SIMPLE_OPS = {
ops.First: "first_value",
ops.Last: "last_value",
}

def visit_DateNow(self, op):
return self.cast(sge.CurrentTimestamp(), dt.date)

@@ -49,6 +44,12 @@ def visit_Correlation(self, op, *, left, right, how, where):
op, left=left, right=right, how=how, where=where
)

def visit_First(self, op, *, arg, where):
return self.agg.first_value(arg, where=where)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is implemented this way as a test case for the definition order, but it turns out to be needed in #9729.


def visit_Last(self, op, *, arg, where):
return self.agg.last_value(arg, where=where)

def visit_TimestampTruncate(self, op, *, arg, unit):
unit_mapping = {
"Y": "year",