@malloy-publisher/server 0.10.5 → 0.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin-api-doc.yaml +4 -1
- package/dist/instrumentation.mjs +1 -1
- package/dist/server.mjs +18 -5
- package/package.json +1 -1
package/dist/admin-api-doc.yaml
CHANGED
|
@@ -234,7 +234,10 @@ paths:
|
|
|
234
234
|
the bytes are rewritten as the catalog's own Parquet, never registered
|
|
235
235
|
in place and never left as rows in the catalog database, so an
|
|
236
236
|
encrypted catalog stays encrypted. One DuckLake transaction:
|
|
237
|
-
a reader sees the old table or the new one.
|
|
237
|
+
a reader sees the old table or the new one. A file the reader refuses
|
|
238
|
+
(not the format it claims, a value it cannot convert) is `400
|
|
239
|
+
INVALID_REQUEST` carrying the reader's own message, with the object
|
|
240
|
+
named by its file name. `201` when the table is new,
|
|
238
241
|
`200` when it replaced one; with `If-None-Match: *` an existing table is
|
|
239
242
|
refused with `412 TABLE_EXISTS`. Synchronous: it answers when the table
|
|
240
243
|
is written.
|
package/dist/instrumentation.mjs
CHANGED
|
@@ -164831,7 +164831,7 @@ var init_telemetry = __esm(() => {
|
|
|
164831
164831
|
});
|
|
164832
164832
|
|
|
164833
164833
|
// package.json
|
|
164834
|
-
var version = "0.10.
|
|
164834
|
+
var version = "0.10.7";
|
|
164835
164835
|
var init_package = () => {};
|
|
164836
164836
|
|
|
164837
164837
|
// src/version.ts
|
package/dist/server.mjs
CHANGED
|
@@ -164832,7 +164832,7 @@ var init_telemetry = __esm(() => {
|
|
|
164832
164832
|
});
|
|
164833
164833
|
|
|
164834
164834
|
// package.json
|
|
164835
|
-
var version = "0.10.
|
|
164835
|
+
var version = "0.10.7";
|
|
164836
164836
|
var init_package = () => {};
|
|
164837
164837
|
|
|
164838
164838
|
// src/version.ts
|
|
@@ -349861,6 +349861,9 @@ function carriesAuthorSql(def) {
|
|
|
349861
349861
|
if (record.type === "sql_select" || record.node === "genericSQLExpr") {
|
|
349862
349862
|
return true;
|
|
349863
349863
|
}
|
|
349864
|
+
if (record.node === "function_call") {
|
|
349865
|
+
return Object.entries(record).some(([key, child]) => key !== "overload" && walk2(child, depth + 1));
|
|
349866
|
+
}
|
|
349864
349867
|
if (record.type === "table" && typeof record.tablePath === "string" && !CATALOG_TABLE_PATH.test(record.tablePath)) {
|
|
349865
349868
|
return true;
|
|
349866
349869
|
}
|
|
@@ -350204,7 +350207,7 @@ async function buildSameCatalogIntoStorage(params) {
|
|
|
350204
350207
|
const { destinationName, destinationConnection, physicalTableName } = params;
|
|
350205
350208
|
const alias = params.sourceConnection.name || destinationName;
|
|
350206
350209
|
if (params.sourceCarriesAuthorSql !== false) {
|
|
350207
|
-
throw new BadRequestError(`Cannot materialize a source that reads storage destination ` + `'${destinationName}' and carries SQL its author wrote (an .sql() source ` + `or a sql_* expression): a build on the catalog runs only Malloy's own SQL. ` + `
|
|
350210
|
+
throw new BadRequestError(`Cannot materialize a source that reads storage destination ` + `'${destinationName}' and carries SQL its author wrote (an .sql() source ` + `or a sql_* expression) or reads a file or URL as a table: a build on the catalog ` + `runs only Malloy's own SQL over the catalog's tables. Express it that way. ` + `Dropping storage= does not help when the source's own connection is the catalog.`);
|
|
350208
350211
|
}
|
|
350209
350212
|
const { session, dispose, workDir } = createIsolatedBuildSession(`build_${destinationName}`);
|
|
350210
350213
|
try {
|
|
@@ -377213,11 +377216,21 @@ async function loadStorageTable(params) {
|
|
|
377213
377216
|
if (params.format === "xlsx") {
|
|
377214
377217
|
await installAndLoadExtension(session, "excel");
|
|
377215
377218
|
}
|
|
377216
|
-
return await writeTableAs(session, params, reader);
|
|
377219
|
+
return await writeTableAs(session, params, reader, (error) => readerRefusal(error, params.uri));
|
|
377217
377220
|
} finally {
|
|
377218
377221
|
await dispose();
|
|
377219
377222
|
}
|
|
377220
377223
|
}
|
|
377224
|
+
function readerRefusal(error, uri) {
|
|
377225
|
+
if (!(error instanceof Error))
|
|
377226
|
+
return null;
|
|
377227
|
+
if (!/^(Invalid Input|Conversion) Error:/.test(error.message))
|
|
377228
|
+
return null;
|
|
377229
|
+
logInternalFailure("Load refused by the file reader", error, "warn");
|
|
377230
|
+
const fileName = path24.posix.basename(uri);
|
|
377231
|
+
const words2 = error.message.split(/\n\s*LINE \d+:/)[0].split(uri).join(fileName).trim();
|
|
377232
|
+
return new BadRequestError(words2);
|
|
377233
|
+
}
|
|
377221
377234
|
async function copyStorageTable(params) {
|
|
377222
377235
|
const { destinationName, destinationConnection, source } = params;
|
|
377223
377236
|
for (const conn of [destinationConnection, source.connection]) {
|
|
@@ -377250,7 +377263,7 @@ async function copyStorageTable(params) {
|
|
|
377250
377263
|
await dispose();
|
|
377251
377264
|
}
|
|
377252
377265
|
}
|
|
377253
|
-
async function writeTableAs(session, params, from) {
|
|
377266
|
+
async function writeTableAs(session, params, from, refused) {
|
|
377254
377267
|
const { destinationName, schemaName, tableName } = params;
|
|
377255
377268
|
await session.runSQL("SET ducklake_default_data_inlining_row_limit = 0");
|
|
377256
377269
|
const target = [destinationName, schemaName, tableName].map((part) => quoteIdentifier(part, "duckdb")).join(".");
|
|
@@ -377260,7 +377273,7 @@ async function writeTableAs(session, params, from) {
|
|
|
377260
377273
|
if (params.mode === "create" && error instanceof Error && /already exists/i.test(error.message)) {
|
|
377261
377274
|
throw new ConflictError(`Table '${schemaName}.${tableName}' already exists in '${destinationName}'.`);
|
|
377262
377275
|
}
|
|
377263
|
-
throw error;
|
|
377276
|
+
throw refused?.(error) ?? error;
|
|
377264
377277
|
}
|
|
377265
377278
|
await session.runSQL(`CALL ducklake_flush_inlined_data('${escapeSQL(destinationName)}', schema_name => '${escapeSQL(schemaName)}', table_name => '${escapeSQL(tableName)}')`);
|
|
377266
377279
|
const counted = rows(await session.runSQL(`SELECT count(*) AS n FROM ${target}`));
|
package/package.json
CHANGED