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

Add initial support for CS DSL in the compiler plugin #783

Merged
merged 3 commits into from
Jul 16, 2024

Conversation

koperagen
Copy link
Collaborator

No description provided.

@koperagen koperagen requested a review from zaleslaw July 16, 2024 12:11
@koperagen koperagen self-assigned this Jul 16, 2024
@koperagen koperagen added this to the 0.14.0 milestone Jul 16, 2024
@koperagen koperagen force-pushed the plugin-column-selection-dsl branch from 261de17 to e6b4152 Compare July 16, 2024 12:22
Copy link
Contributor

Generated sources will be updated after merging this PR.
Please inspect the changes in here.


class Into0 : AbstractSchemaModificationInterpreter() {
val Arguments.receiver: GroupClauseApproximation by arg()
val Arguments.column: String by arg()

override fun Arguments.interpret(): PluginDataFrameSchema {
val grouped = groupImpl(receiver.df.columns(), receiver.columns.mapTo(mutableSetOf()) { it.path.path }, column)
val grouped = groupImpl(receiver.df.columns(), receiver.columns.resolve(receiver.df).mapTo(mutableSetOf()) { it.path.path }, column)
Copy link
Collaborator

Choose a reason for hiding this comment

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

that is reciever.df here?

Copy link
Collaborator Author

@koperagen koperagen Jul 16, 2024

Choose a reason for hiding this comment

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

Given this call:
df.group { a }.into("abc")
receiver = df.group { a }. Because it's a function call, its result is also interpreted. It becames GroupClauseApproximation, and so receiver.df is df.group { a }
Receiver is a special name for "this"

@koperagen koperagen merged commit 5efb5ff into master Jul 16, 2024
5 checks passed
@Jolanrensen Jolanrensen added the Compiler plugin Anything related to the DataFrame Compiler Plugin label Aug 8, 2024
@koperagen koperagen deleted the plugin-column-selection-dsl branch August 26, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compiler plugin Anything related to the DataFrame Compiler Plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants