Skip to content

testing: adding catalog api and large table fetch benchmark testcase#1561

Open
Anshu6250 wants to merge 6 commits into
mainfrom
catalog-api-benchmarks
Open

testing: adding catalog api and large table fetch benchmark testcase#1561
Anshu6250 wants to merge 6 commits into
mainfrom
catalog-api-benchmarks

Conversation

@Anshu6250

@Anshu6250 Anshu6250 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

This PR groups all catalog and data fetch benchmarks into a single file (catalog_performance_example.cc) and introduces a custom performance_test CMake target. Now, we can isolate and execute only the performance tests by running cmake --build build --target performance_test.

MacOS and Windows Pipeline: link

@Anshu6250 Anshu6250 changed the title testing: adding catalop api benchmark testcase testing: adding catalog api benchmark testcase Jun 15, 2026
ASSERT_EQ(Connect(connection_string, conn), SQL_SUCCESS) << "Failed to connect to the database.";

// Generate 90 Lakh (9,000,000) rows by cross-joining two arrays of 3,000
std::string query = R"(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

don't do this, utilise the existing tables like kirltest tables for huge data and all_data_types I think exists for all data types

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

@Anshu6250 Anshu6250 force-pushed the catalog-api-benchmarks branch 4 times, most recently from 15288a7 to f36e919 Compare June 16, 2026 10:52
@Anshu6250 Anshu6250 changed the title testing: adding catalog api benchmark testcase testing: adding catalog api and large table fetch benchmark testcase Jun 16, 2026
case SQL_FLOAT:
case SQL_DOUBLE: col_ptr->data_type = SQL_C_DOUBLE; break;
case SQL_BIT: col_ptr->data_type = SQL_C_BIT; break;
default: col_ptr->data_type = SQL_C_CHAR; break;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

have cases for other data types as well like date, time, numeric, range

DescribeCol(conn, col_ptr, i);

switch (col_ptr->data_type) {
case SQL_BIGINT:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same here have cases for other data types as well like date, time, numeric, range

TEST(DataFetchPerformance, Benchmark_PowerBI_Mimic_NewTimestampTable) {
auto conn = std::make_shared<ODBCHandles>();

std::string connection_string = kDefaultConnectionString + ";AllowHtapiForLargeResults=1;HTAPI_ActivationThreshold=0;";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

make all test cases parametrized and run with htapi and without

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

DescribeCol(conn, col_ptr, i);

switch (col_ptr->data_type) {
case SQL_BIGINT:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

instead of doing this , use SqlToCdataTypes(col_ptr) instead , as here we are not doing conversion simply returning as string, maybe can have a separate test case to bind with SQL_C_CHAR only

@Anshu6250 Anshu6250 force-pushed the catalog-api-benchmarks branch 2 times, most recently from a21251d to c73f564 Compare June 17, 2026 09:21
@sachinpro

Copy link
Copy Markdown
Collaborator
  1. There should be a separate cmake target.
  2. The benchmark CI pipeline should not build the driver, only that target.
  3. After building the installer, windows-cmake CI pipeline should trigger another one for benchmarks. The installer should be uploaded to bq-dev-tools-testing-drivers/odbc-perf/ and a text file with the results will be uploaded by the 2nd pipeline.

@sachinpro

Copy link
Copy Markdown
Collaborator

@Anshu6250 In this PR, create the cmake target only. We can make the CI changes in the next one.

break;
case SQL_VARCHAR:
case SQL_CHAR:
case SQL_NUMERIC:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why are we returning SQL_NUMERIC and SQL_DECIMAL as SQL_C_CHAR ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We map them to SQL_C_CHAR to prevent precision loss, as BigQuery's exact-precision types support up to 38-76 digits of precision. Standard C++ double types max out at 15-17 digits, so fetching them as strings is the safest way to extract the data without introducing silent truncation or rounding errors

@Anshu6250 Anshu6250 force-pushed the catalog-api-benchmarks branch from ffd8387 to 5de256e Compare June 24, 2026 09:01
@Anshu6250 Anshu6250 force-pushed the catalog-api-benchmarks branch from 5de256e to 8b5644d Compare June 24, 2026 10:08
@Anshu6250 Anshu6250 force-pushed the catalog-api-benchmarks branch from 8b5644d to a94193b Compare June 24, 2026 10:13
@shivamd-gpartner shivamd-gpartner marked this pull request as ready for review June 24, 2026 12:59
@shivamd-gpartner shivamd-gpartner requested a review from a team as a code owner June 24, 2026 12:59
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.

4 participants