diff --git a/pg_lake_benchmark/src/tpcds.c b/pg_lake_benchmark/src/tpcds.c index f88ab28d..58036a8b 100644 --- a/pg_lake_benchmark/src/tpcds.c +++ b/pg_lake_benchmark/src/tpcds.c @@ -73,7 +73,7 @@ pg_lake_tpcds_gen(PG_FUNCTION_ARGS) if (!IsSupportedURL(location)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("only s3://, gs://, az://, azure://, and abfss:// URLs are " + errmsg("only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are " "currently supported"))); Oid tableTypeId = (BenchmarkTableType) PG_GETARG_OID(1); diff --git a/pg_lake_benchmark/src/tpch.c b/pg_lake_benchmark/src/tpch.c index b21ef35b..ff4f4d9e 100644 --- a/pg_lake_benchmark/src/tpch.c +++ b/pg_lake_benchmark/src/tpch.c @@ -70,7 +70,7 @@ pg_lake_tpch_gen(PG_FUNCTION_ARGS) if (!IsSupportedURL(location)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("only s3://, gs://, az://, azure://, and abfss:// URLs are " + errmsg("only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are " "currently supported"))); Oid tableTypeId = (BenchmarkTableType) PG_GETARG_OID(1); @@ -104,7 +104,7 @@ pg_lake_tpch_gen_partitioned(PG_FUNCTION_ARGS) if (!IsSupportedURL(location)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("only s3://, gs://, az://, azure://, and abfss:// URLs are " + errmsg("only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are " "currently supported"))); Oid tableTypeId = (BenchmarkTableType) PG_GETARG_OID(1); diff --git a/pg_lake_copy/src/ddl/create_table.c b/pg_lake_copy/src/ddl/create_table.c index 0c35d3d9..b219daef 100644 --- a/pg_lake_copy/src/ddl/create_table.c +++ b/pg_lake_copy/src/ddl/create_table.c @@ -173,7 +173,7 @@ ProcessCreateFromFile(CreateStmt *createStmt, if (!IsSupportedURL(definitionFromURL)) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("pg_lake_copy: only s3://, gs://, az://, azure://, and abfss:// URLs are " + errmsg("pg_lake_copy: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are " "currently supported"))); } @@ -194,7 +194,7 @@ ProcessCreateFromFile(CreateStmt *createStmt, if (!IsSupportedURL(loadFromURL)) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("pg_lake_copy: only s3://, gs://, az://, azure://, and abfss:// URLs are " + errmsg("pg_lake_copy: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are " "currently supported"))); } diff --git a/pg_lake_copy/tests/pytests/test_create_table.py b/pg_lake_copy/tests/pytests/test_create_table.py index cafa8978..4fd4c724 100644 --- a/pg_lake_copy/tests/pytests/test_create_table.py +++ b/pg_lake_copy/tests/pytests/test_create_table.py @@ -302,7 +302,7 @@ def test_create_table_load_from_invalid_url(pg_conn, duckdb_conn, s3): raise_error=False, ) assert error.startswith( - "ERROR: pg_lake_copy: only s3://, gs://, az://, azure://, and abfss:// URLs are currently supported" + "ERROR: pg_lake_copy: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are currently supported" ) pg_conn.rollback() @@ -315,7 +315,7 @@ def test_create_table_load_from_invalid_url(pg_conn, duckdb_conn, s3): raise_error=False, ) assert error.startswith( - "ERROR: pg_lake_copy: only s3://, gs://, az://, azure://, and abfss:// URLs are currently supported" + "ERROR: pg_lake_copy: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are currently supported" ) pg_conn.rollback() diff --git a/pg_lake_engine/include/pg_lake/copy/copy_format.h b/pg_lake_engine/include/pg_lake/copy/copy_format.h index 0237c59c..89190706 100644 --- a/pg_lake_engine/include/pg_lake/copy/copy_format.h +++ b/pg_lake_engine/include/pg_lake/copy/copy_format.h @@ -30,6 +30,7 @@ #define HTTP_URL_PREFIX "http://" #define HTTPS_URL_PREFIX "https://" #define HUGGING_FACE_URL_PREFIX "hf://" +#define R2_URL_PREFIX "r2://" #define STAGE_URL_PREFIX "@STAGE/" diff --git a/pg_lake_engine/src/copy/copy_format.c b/pg_lake_engine/src/copy/copy_format.c index 18a79455..7753c8cb 100644 --- a/pg_lake_engine/src/copy/copy_format.c +++ b/pg_lake_engine/src/copy/copy_format.c @@ -437,7 +437,8 @@ IsSupportedURL(const char *path) strncmp(path, AZURE_DLS_URL_PREFIX, strlen(AZURE_DLS_URL_PREFIX)) == 0 || strncmp(path, HTTP_URL_PREFIX, strlen(HTTP_URL_PREFIX)) == 0 || strncmp(path, HTTPS_URL_PREFIX, strlen(HTTPS_URL_PREFIX)) == 0 || - strncmp(path, HUGGING_FACE_URL_PREFIX, strlen(HUGGING_FACE_URL_PREFIX)) == 0; + strncmp(path, HUGGING_FACE_URL_PREFIX, strlen(HUGGING_FACE_URL_PREFIX)) == 0 || + strncmp(path, R2_URL_PREFIX, strlen(R2_URL_PREFIX)) == 0; } diff --git a/pg_lake_iceberg/src/iceberg/iceberg_functions.c b/pg_lake_iceberg/src/iceberg/iceberg_functions.c index 3c73a501..9ae0eff0 100644 --- a/pg_lake_iceberg/src/iceberg/iceberg_functions.c +++ b/pg_lake_iceberg/src/iceberg/iceberg_functions.c @@ -49,7 +49,7 @@ iceberg_metadata(PG_FUNCTION_ARGS) if (!IsSupportedURL(metadataUri)) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("pg_lake_iceberg: only s3://, gs://, az://, azure://, and abfss:// are supported"))); + errmsg("pg_lake_iceberg: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// are supported"))); } CheckURLReadAccess(); @@ -71,7 +71,7 @@ iceberg_files(PG_FUNCTION_ARGS) if (!IsSupportedURL(metadataUri)) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("pg_lake_iceberg: only s3://, gs://, az://, azure://, and abfss:// are supported"))); + errmsg("pg_lake_iceberg: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// are supported"))); } CheckURLReadAccess(); @@ -144,7 +144,7 @@ iceberg_snapshots(PG_FUNCTION_ARGS) if (!IsSupportedURL(metadataUri)) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("pg_lake_iceberg: only s3://, gs://, az://, azure://, and abfss:// are supported"))); + errmsg("pg_lake_iceberg: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// are supported"))); } CheckURLReadAccess(); diff --git a/pg_lake_iceberg/src/init.c b/pg_lake_iceberg/src/init.c index 63972e7b..fc171335 100644 --- a/pg_lake_iceberg/src/init.c +++ b/pg_lake_iceberg/src/init.c @@ -345,7 +345,7 @@ IcebergDefaultLocationCheckHook(char **newvalue, void **extra, GucSource source) if (!IsSupportedURL(newLocationPrefix)) { - GUC_check_errdetail("pg_lake_iceberg: only s3://, gs://, az://, azure://, and abfss:// URLs are " + GUC_check_errdetail("pg_lake_iceberg: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are " "supported as the default location prefix"); return false; } diff --git a/pg_lake_iceberg/tests/pytests/test_iceberg_functions.py b/pg_lake_iceberg/tests/pytests/test_iceberg_functions.py index 2f5b2fc2..83499063 100644 --- a/pg_lake_iceberg/tests/pytests/test_iceberg_functions.py +++ b/pg_lake_iceberg/tests/pytests/test_iceberg_functions.py @@ -49,7 +49,7 @@ def test_pg_lake_iceberg_table_metadata( ) assert ( - "pg_lake_iceberg: only s3://, gs://, az://, azure://, and abfss:// are supported" + "pg_lake_iceberg: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// are supported" in error ) @@ -111,7 +111,7 @@ def test_unsupported_url(installcheck, superuser_conn, iceberg_extension, s3): error = run_query(query, superuser_conn, raise_error=False) assert ( - "pg_lake_iceberg: only s3://, gs://, az://, azure://, and abfss:// are supported" + "pg_lake_iceberg: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// are supported" in error ) diff --git a/pg_lake_table/src/ddl/create_table.c b/pg_lake_table/src/ddl/create_table.c index 510cd7d4..87f48083 100644 --- a/pg_lake_table/src/ddl/create_table.c +++ b/pg_lake_table/src/ddl/create_table.c @@ -380,14 +380,14 @@ ErrorIfUnsupportedLakeTable(CreateForeignTableStmt *createStmt) if (!isWritable && !IsSupportedURL(path)) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("pg_lake_table: only s3://, gs://, az://, azure://, and abfss:// URLs are " + errmsg("pg_lake_table: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are " "currently supported"))); } else if (isWritable && !IsSupportedURL(location)) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("pg_lake_table: only s3://, gs://, az://, azure://, and abfss:// URLs are " + errmsg("pg_lake_table: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are " "currently supported"))); } diff --git a/pg_lake_table/src/fdw/option.c b/pg_lake_table/src/fdw/option.c index fca5c637..94828ebf 100644 --- a/pg_lake_table/src/fdw/option.c +++ b/pg_lake_table/src/fdw/option.c @@ -204,7 +204,7 @@ pg_lake_table_validator(PG_FUNCTION_ARGS) if (!IsSupportedURL(path)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("pg_lake_table: only s3://, gs://, az://, azure://, and abfss:// " + errmsg("pg_lake_table: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// " "URLs are currently supported for the \"path\" " "option."))); @@ -216,7 +216,7 @@ pg_lake_table_validator(PG_FUNCTION_ARGS) if (!IsSupportedURL(value)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("pg_lake_table: only s3://, gs://, az://, azure://, and abfss:// " + errmsg("pg_lake_table: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// " "URLs are currently supported for the \"location\" " "option."))); @@ -726,7 +726,7 @@ pg_lake_iceberg_validator(PG_FUNCTION_ARGS) if (!IsSupportedURL(location)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("pg_lake_iceberg: only s3://, gs://, az://, azure://, and abfss:// " + errmsg("pg_lake_iceberg: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// " "URLs are currently supported for the \"location\" " "option."))); diff --git a/pg_lake_table/src/util/s3_file_utils.c b/pg_lake_table/src/util/s3_file_utils.c index bc47716e..5c7b25f8 100644 --- a/pg_lake_table/src/util/s3_file_utils.c +++ b/pg_lake_table/src/util/s3_file_utils.c @@ -62,7 +62,7 @@ pg_lake_file_size(PG_FUNCTION_ARGS) /* sanity-check URL */ if (!IsSupportedURL(path)) - ereport(ERROR, (errmsg("file_size: only s3://, gs://, az://, azure://, and abfss:// urls are supported"), + ereport(ERROR, (errmsg("file_size: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// urls are supported"), errcode(ERRCODE_INVALID_PARAMETER_VALUE))); CheckURLReadAccess(); @@ -94,7 +94,7 @@ pg_lake_list_files(PG_FUNCTION_ARGS) /* sanity-check URL */ if (!IsSupportedURL(globURL) || !IsFileListSupportedUrl(globURL)) - ereport(ERROR, (errmsg("list_files: only s3://, gs://, az://, azure://, abfss://, and hf:// urls are supported"), + ereport(ERROR, (errmsg("list_files: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// urls are supported"), errcode(ERRCODE_INVALID_PARAMETER_VALUE))); CheckURLReadAccess(); @@ -143,7 +143,8 @@ IsFileListSupportedUrl(char *path) strncmp(path, AZURE_URL_PREFIX, strlen(AZURE_URL_PREFIX)) == 0 || strncmp(path, AZURE_BLOB_URL_PREFIX, strlen(AZURE_BLOB_URL_PREFIX)) == 0 || strncmp(path, AZURE_DLS_URL_PREFIX, strlen(AZURE_DLS_URL_PREFIX)) == 0 || - strncmp(path, HUGGING_FACE_URL_PREFIX, strlen(HUGGING_FACE_URL_PREFIX)) == 0; + strncmp(path, HUGGING_FACE_URL_PREFIX, strlen(HUGGING_FACE_URL_PREFIX)) == 0 || + strncmp(path, R2_URL_PREFIX, strlen(R2_URL_PREFIX)) == 0; } @@ -160,7 +161,7 @@ pg_lake_file_exists(PG_FUNCTION_ARGS) /* sanity-check URL */ if (!IsSupportedURL(path)) - ereport(ERROR, (errmsg("file_exists: only s3://, gs://, az://, azure://, and abfss:// urls are supported"), + ereport(ERROR, (errmsg("file_exists: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// urls are supported"), errcode(ERRCODE_INVALID_PARAMETER_VALUE))); CheckURLReadAccess(); @@ -218,7 +219,7 @@ pg_lake_file_preview(PG_FUNCTION_ARGS) /* sanity-check URL */ if (!IsSupportedURL(url)) - ereport(ERROR, (errmsg("file_preview: only s3://, gs://, az://, azure://, and abfss:// urls are supported"), + ereport(ERROR, (errmsg("file_preview: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// urls are supported"), errcode(ERRCODE_INVALID_PARAMETER_VALUE))); CheckURLReadAccess(); @@ -269,7 +270,7 @@ pg_lake_delete_file(PG_FUNCTION_ARGS) /* sanity-check URL */ if (!IsSupportedURL(path)) - ereport(ERROR, (errmsg("delete_file: only s3://, gs://, az://, azure://, and abfss:// urls are supported"), + ereport(ERROR, (errmsg("delete_file: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// urls are supported"), errcode(ERRCODE_INVALID_PARAMETER_VALUE))); CheckURLWriteAccess(); diff --git a/pg_lake_table/tests/pytests/test_create_as_select.py b/pg_lake_table/tests/pytests/test_create_as_select.py index 1b057519..bbe01db4 100644 --- a/pg_lake_table/tests/pytests/test_create_as_select.py +++ b/pg_lake_table/tests/pytests/test_create_as_select.py @@ -57,7 +57,7 @@ def test_unsupported_url(s3, pg_conn, extension): pg_conn, raise_error=False, ) - assert "only s3://, gs://, az://, azure://, and abfss:// URLs" in error + assert "only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs" in error pg_conn.rollback() diff --git a/pg_lake_table/tests/pytests/test_create_iceberg_table_load_from.py b/pg_lake_table/tests/pytests/test_create_iceberg_table_load_from.py index 06207f74..6426341a 100644 --- a/pg_lake_table/tests/pytests/test_create_iceberg_table_load_from.py +++ b/pg_lake_table/tests/pytests/test_create_iceberg_table_load_from.py @@ -274,7 +274,7 @@ def test_create_table_load_from_invalid_url( raise_error=False, ) assert error.startswith( - "ERROR: pg_lake_copy: only s3://, gs://, az://, azure://, and abfss:// URLs are currently supported" + "ERROR: pg_lake_copy: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are currently supported" ) pg_conn.rollback() @@ -287,7 +287,7 @@ def test_create_table_load_from_invalid_url( raise_error=False, ) assert error.startswith( - "ERROR: pg_lake_copy: only s3://, gs://, az://, azure://, and abfss:// URLs are currently supported" + "ERROR: pg_lake_copy: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are currently supported" ) pg_conn.rollback() diff --git a/pg_lake_table/tests/pytests/test_file_preview.py b/pg_lake_table/tests/pytests/test_file_preview.py index f6957987..3fd07dbb 100644 --- a/pg_lake_table/tests/pytests/test_file_preview.py +++ b/pg_lake_table/tests/pytests/test_file_preview.py @@ -56,7 +56,7 @@ def test_file_preview_non_s3_url(pg_conn, extension): raise_error=False, ) assert ( - "only s3://, gs://, az://, azure://, and abfss:// urls are supported" in error + "only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// urls are supported" in error ) pg_conn.rollback() diff --git a/pg_lake_table/tests/pytests/test_list_file.py b/pg_lake_table/tests/pytests/test_list_file.py index 6bbbef46..a879eef7 100644 --- a/pg_lake_table/tests/pytests/test_list_file.py +++ b/pg_lake_table/tests/pytests/test_list_file.py @@ -31,7 +31,7 @@ def test_list_files_non_s3_url(pg_conn, generate_data_on_s3): raise_error=False, ) assert ( - "only s3://, gs://, az://, azure://, abfss://, and hf:// urls are supported" + "only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// urls are supported" in error ) pg_conn.rollback() diff --git a/pg_lake_table/tests/pytests/test_queries.py b/pg_lake_table/tests/pytests/test_queries.py index 78ab7c56..7ec7ab68 100644 --- a/pg_lake_table/tests/pytests/test_queries.py +++ b/pg_lake_table/tests/pytests/test_queries.py @@ -1331,7 +1331,7 @@ def test_fdw_table_without_path(pg_conn, s3, extension): except psycopg2.errors.FeatureNotSupported as e: assert ( - "pg_lake_table: only s3://, gs://, az://, azure://, and abfss:// URLs are currently supported" + "pg_lake_table: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are currently supported" in str(e) ) cur.close() @@ -1356,7 +1356,7 @@ def test_fdw_table_without_path(pg_conn, s3, extension): except psycopg2.errors.FeatureNotSupported as e: assert ( str(e) - == 'pg_lake_table: only s3://, gs://, az://, azure://, and abfss:// URLs are currently supported for the "path" option.\n' + == 'pg_lake_table: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are currently supported for the "path" option.\n' ) cur.close() pg_conn.commit() diff --git a/pg_lake_table/tests/pytests/test_writable_iceberg.py b/pg_lake_table/tests/pytests/test_writable_iceberg.py index ac4f3084..0d3b5e4a 100644 --- a/pg_lake_table/tests/pytests/test_writable_iceberg.py +++ b/pg_lake_table/tests/pytests/test_writable_iceberg.py @@ -111,7 +111,7 @@ def test_writable_iceberg_create_wrong_option(pg_conn, extension): raise_error=False, ) assert ( - 'pg_lake_iceberg: only s3://, gs://, az://, azure://, and abfss:// URLs are currently supported for the "location" option.' + 'pg_lake_iceberg: only s3://, gs://, az://, azure://, abfss://, hf://, and r2:// URLs are currently supported for the "location" option.' in str(error) ) pg_conn.rollback()