Skip to content

PECO-1054 Expose Arrow batches to users, part three#166

Merged
rcypher-databricks merged 6 commits into
databricks:mainfrom
rcypher-databricks:arrow_batches
Sep 29, 2023
Merged

PECO-1054 Expose Arrow batches to users, part three#166
rcypher-databricks merged 6 commits into
databricks:mainfrom
rcypher-databricks:arrow_batches

Conversation

@rcypher-databricks

Copy link
Copy Markdown
Contributor

Added DBSqlRows and DBSQLArrowBatchIterator public interfaces.
Added arrowRecordIterator which implements DBSQLArrowBatchIterator.
Moved closing the database operation from rows type into resultPageIterator as well as properties that are only used by resultPageIterator.
Added GetArrowBatches function to rows and arrowRowScanner types.
Added HasNext function to BatchIterator and SparkArrowBatch interfaces.
Added example for accessing Arrow batches and updated doc.go

Comment thread doc.go Outdated
conn, _ := db.Conn(context.BackGround())
defer conn.Close()

query := `select * from hive_metastore.main.taxi_trip_data`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change to UC. main.default.<>

Comment thread examples/arrrowbatches/main.go Outdated
ctx2, cancel2 := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel2()

batches, err := rows.(dbsqlrows.DBSQLRows).GetArrowBatches(ctx2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is DBSQL something that we actually expose externally as an acronym? Any alternatives to this?

@andrefurlan-db andrefurlan-db left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just a couple of annoying comments to make sure we name things that we expose as interface correctly. The rest looks awesome!

Added DBSqlRows and DBSQLArrowBatchIterator public interfaces.
Added arrowRecordIterator which implements  DBSQLArrowBatchIterator.
Moved closing the db operation from rows type into resultPageIterator as well as properties that are only used by resultPageIterator.
Added GetArrowBatches function to rows and arrowRowScanner types.
Added HasNext function to BatchIterator and SparkArrowBatch interfaces.
Added example for accessing Arrow batches and updated doc.go

Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
Renamed DBSQLRows and DBSQLArrowBatchIterator to Rows and ArrowBatchIterator by dropping the DBSQL prefix.
Updated example to use UC

Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>

@andrefurlan-db andrefurlan-db left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good job

@rcypher-databricks
rcypher-databricks merged commit 6bb1879 into databricks:main Sep 29, 2023
mani-mathur-arch added a commit that referenced this pull request Jul 16, 2026
Bumps the kernel pin from the placeholder statement-surface rev to the tip of
the tier2-features branch (databricks-sql-kernel#167 @ 02c0a43), the head of the
unmerged kernel PR stack (#165 -> #166 cancel-token -> #167 tier2). It's a linear
superset carrying every new C-ABI symbol these driver branches link against:
kernel_session_open_cancellable / kernel_result_stream_next_batch_cancellable
(cancel token, #166) plus kernel_abi_version, kernel_session_close_blocking,
set_tls_client_certificate, set_cloudfetch_enabled (#167). The kernel-lib build
fetches the bare commit via its PR-head-ref fallback, so an unmerged SHA is
buildable. Temporary: re-pin to the squash-merge SHA once the kernel stack lands.

Co-authored-by: Isaac
Signed-off-by: Mani Kaustubh Mathur <mani.mathur@databricks.com>
mani-mathur-arch added a commit that referenced this pull request Jul 17, 2026
Bumps the kernel pin from the placeholder statement-surface rev to the tip of
the tier2-features branch (databricks-sql-kernel#167 @ 02c0a43), the head of the
unmerged kernel PR stack (#165 -> #166 cancel-token -> #167 tier2). It's a linear
superset carrying every new C-ABI symbol these driver branches link against:
kernel_session_open_cancellable / kernel_result_stream_next_batch_cancellable
(cancel token, #166) plus kernel_abi_version, kernel_session_close_blocking,
set_tls_client_certificate, set_cloudfetch_enabled (#167). The kernel-lib build
fetches the bare commit via its PR-head-ref fallback, so an unmerged SHA is
buildable. Temporary: re-pin to the squash-merge SHA once the kernel stack lands.

Co-authored-by: Isaac
Signed-off-by: Mani Kaustubh Mathur <mani.mathur@databricks.com>
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

Successfully merging this pull request may close these issues.

2 participants