Skip to content
Merged
Changes from all commits
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
25 changes: 13 additions & 12 deletions tests/e2e/kernel/execution-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('kernel execution end-to-end', function e2eSuite() {
await client.close();
});

it('passes sessionConfig (Spark conf) through openSession.configuration', async () => {
it('passes session configuration through openSession.configuration', async () => {
const client = new DBSQLClient();

await client.connect({
Expand All @@ -103,23 +103,24 @@ describe('kernel execution end-to-end', function e2eSuite() {
useKernel: true,
} as ConnectionOptions & InternalConnectionOptions);

// Sanity-check that supplying session-level Spark conf does not
// break openSession. The SEA wire applies these as `parameters` on
// every executeStatement; we don't observe them in the response
// for M0, but the absence of an error proves the napi binding
// accepts and forwards the map.
// Use a supported SQL session parameter and verify that it affects
// statement execution, proving the napi binding forwards the map.
const session = await client.openSession({
initialCatalog: 'main',
configuration: {
'spark.sql.session.timeZone': 'UTC',
TIMEZONE: 'America/Los_Angeles',
},
});

const operation = await session.executeStatement('SELECT 1', {});
await operation.close();

await session.close();
await client.close();
let operation;
try {
operation = await session.executeStatement('SELECT current_timezone() AS timezone', {});
expect(await operation.fetchAll()).to.deep.equal([{ timezone: 'America/Los_Angeles' }]);
} finally {
await operation?.close();
await session.close();
await client.close();
}
});

it('binds ordinary positional parameters through rawParams', async () => {
Expand Down
Loading