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

Small question/clarification about whether something would fit into Logical Plans or Physical Plans #8

Open
GavinRay97 opened this issue Mar 22, 2022 · 0 comments

Comments

@GavinRay97
Copy link

To cement my understanding of the book, I'm working through it a second time, this time changing the implementation from using Arrow vectors + types (columnar) to row-based data (Map<String, Any>) and JDBC types:

data class Field(val name: String, val type: JDBCType)
data class Schema(val fields: List<Field>)

interface DataSource {
    fun schema(): Schema
    fun scan(projection: List<String>): Sequence<Map<String, Any?>>
}

// Physical plans return iterators over rows.
interface PhysicalPlan {
    fun schema(): Schema
    fun children(): List<PhysicalPlan>
    fun execute(): Sequence<Map<String, Any?>>
}

// Physical expression interface
interface Expression {
    fun evaluate(rows: Map<String, Any?>): Any?
}

My question is this:

If I have different "translation" strategies for converting Logical Plans to SQL, which then get executed as a IE a JDBC query -- would these be considered different Physical Plans or would they be implementation details of the same Physical Plan?

IE, translating a Logical Plan to a SQL string with StringBuilder, versus using an ORM/Query-builder like jOOQ:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant