Skip to content
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pg_lake_benchmark/src/tpcds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions pg_lake_benchmark/src/tpch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions pg_lake_copy/src/ddl/create_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}

Expand All @@ -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")));
}

Expand Down
4 changes: 2 additions & 2 deletions pg_lake_copy/tests/pytests/test_create_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
1 change: 1 addition & 0 deletions pg_lake_engine/include/pg_lake/copy/copy_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -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/"


Expand Down
3 changes: 2 additions & 1 deletion pg_lake_engine/src/copy/copy_format.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down
6 changes: 3 additions & 3 deletions pg_lake_iceberg/src/iceberg/iceberg_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion pg_lake_iceberg/src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions pg_lake_iceberg/tests/pytests/test_iceberg_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -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
)

Expand Down
4 changes: 2 additions & 2 deletions pg_lake_table/src/ddl/create_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}

Expand Down
6 changes: 3 additions & 3 deletions pg_lake_table/src/fdw/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.")));

Expand All @@ -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.")));

Expand Down Expand Up @@ -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.")));

Expand Down
13 changes: 7 additions & 6 deletions pg_lake_table/src/util/s3_file_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}


Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion pg_lake_table/tests/pytests/test_create_as_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion pg_lake_table/tests/pytests/test_file_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion pg_lake_table/tests/pytests/test_list_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions pg_lake_table/tests/pytests/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion pg_lake_table/tests/pytests/test_writable_iceberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down