Skip to content

ArrowIPCStreamIterator.SchemaBytes() returns zero bytes after a cold start #312

@datbth

Description

@datbth

Context

Given an Databricks SQL Warehouse that is currently stopped and this code:

	driverCntor, driverErr := dbsql.NewConnector(options...)
	if driverErr != nil {
		return driverErr
	}

	conn, connErr := driverCntor.Connect(ctx)
	if connErr != nil {
		return connErr
	}

	ctx := context.Background()
	rows, queryErr := conn.(driver.QueryerContext).QueryContext(ctx, "SELECT 1", []driver.NamedValue{})
	if queryErr != nil {
		return queryErr
	}
	defer rows.Close()

	ipcStreamIt, ipcStreamErr := rows.(dbsqlrows.Rows).GetArrowIPCStreams(ctx)
	if ipcStreamErr != nil {
		return ipcStreamErr
	}
	defer ipcStreamIt.Close()

	schemaBytes, schemaErr := ipcStreamIt.SchemaBytes()
	if schemaErr != nil {
		return schemaErr
	}

	if len(schemaBytes) == 0 {
		return fmt.Errorf("no schema bytes")
	}

Expected result

No error

Actual result

Error: no schema bytes

Notes

  • This only happens when the Databricks SQL Warehouse is stopped
  • When the Databricks SQL Warehouse is active, schemaBytes contains correct data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions