duckdb 0.7.1-dev53.0 → 0.7.1-dev68.0

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
4
  "types": "./lib/duckdb.d.ts",
5
- "version": "0.7.1-dev53.0",
5
+ "version": "0.7.1-dev68.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -3,6 +3,7 @@
3
3
  #include "duckdb/main/database.hpp"
4
4
  #include "duckdb/parallel/task_scheduler.hpp"
5
5
  #include "duckdb/storage/buffer_manager.hpp"
6
+ #include "duckdb/main/extension_helper.hpp"
6
7
 
7
8
  namespace duckdb {
8
9
 
@@ -75,7 +76,7 @@ void JSONScanData::InitializeFilePaths(ClientContext &context, const vector<stri
75
76
  for (auto &file_pattern : patterns) {
76
77
  auto found_files = fs.Glob(file_pattern, context);
77
78
  if (found_files.empty()) {
78
- throw IOException("No files found that match the pattern \"%s\"", file_pattern);
79
+ throw FileSystem::MissingFileException(file_pattern, context);
79
80
  }
80
81
  file_paths.insert(file_paths.end(), found_files.begin(), found_files.end());
81
82
  }
@@ -223,7 +223,7 @@ public:
223
223
  FileSystem &fs = FileSystem::GetFileSystem(context);
224
224
  auto files = fs.Glob(info.file_path, context);
225
225
  if (files.empty()) {
226
- throw IOException("No files found that match the pattern \"%s\"", info.file_path);
226
+ throw FileSystem::MissingFileException(info.file_path, context);
227
227
  }
228
228
 
229
229
  // The most likely path (Parquet read without union by name option)
@@ -363,8 +363,9 @@ public:
363
363
 
364
364
  static vector<string> ParquetGlob(FileSystem &fs, const string &glob, ClientContext &context) {
365
365
  auto files = fs.Glob(glob, FileSystem::GetFileOpener(context));
366
+
366
367
  if (files.empty()) {
367
- throw IOException("No files found that match the pattern \"%s\"", glob);
368
+ throw FileSystem::MissingFileException(glob, context);
368
369
  }
369
370
  return files;
370
371
  }
@@ -335,6 +335,20 @@ bool FileSystem::CanHandleFile(const string &fpath) {
335
335
  throw NotImplementedException("%s: CanHandleFile is not implemented!", GetName());
336
336
  }
337
337
 
338
+ IOException FileSystem::MissingFileException(const string &file_path, ClientContext &context) {
339
+ const string prefixes[] = {"http://", "https://", "s3://"};
340
+ for (auto &prefix : prefixes) {
341
+ if (StringUtil::StartsWith(file_path, prefix)) {
342
+ if (!context.db->LoadedExtensions().count("httpfs")) {
343
+ return MissingExtensionException("No files found that match the pattern \"%s\", because the httpfs "
344
+ "extension is not loaded. Try loading the extension: LOAD HTTPFS",
345
+ file_path);
346
+ }
347
+ }
348
+ }
349
+ return IOException("No files found that match the pattern \"%s\"", file_path);
350
+ }
351
+
338
352
  void FileSystem::Seek(FileHandle &handle, idx_t location) {
339
353
  throw NotImplementedException("%s: Seek is not implemented!", GetName());
340
354
  }
@@ -10,6 +10,7 @@
10
10
  #include "duckdb/parser/expression/function_expression.hpp"
11
11
  #include "duckdb/parser/tableref/table_function_ref.hpp"
12
12
  #include "duckdb/planner/operator/logical_get.hpp"
13
+ #include "duckdb/main/extension_helper.hpp"
13
14
 
14
15
  #include <limits>
15
16
 
@@ -29,7 +30,7 @@ void ReadCSVData::InitializeFiles(ClientContext &context, const vector<string> &
29
30
  for (auto &file_pattern : patterns) {
30
31
  auto found_files = fs.Glob(file_pattern, context);
31
32
  if (found_files.empty()) {
32
- throw IOException("No files found that match the pattern \"%s\"", file_pattern);
33
+ throw FileSystem::MissingFileException(file_pattern, context);
33
34
  }
34
35
  files.insert(files.end(), found_files.begin(), found_files.end());
35
36
  }
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.7.1-dev53"
2
+ #define DUCKDB_VERSION "0.7.1-dev68"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "fc7f6f288d"
5
+ #define DUCKDB_SOURCE_ID "8ef0b5c610"
6
6
  #endif
7
7
  #include "duckdb/function/table/system_functions.hpp"
8
8
  #include "duckdb/main/database.hpp"
@@ -262,6 +262,16 @@ public:
262
262
  }
263
263
  };
264
264
 
265
+ class MissingExtensionException : public IOException {
266
+ public:
267
+ DUCKDB_API explicit MissingExtensionException(const string &msg);
268
+
269
+ template <typename... Args>
270
+ explicit MissingExtensionException(const string &msg, Args... params)
271
+ : IOException(ConstructMessage(msg, params...)) {
272
+ }
273
+ };
274
+
265
275
  class SerializationException : public Exception {
266
276
  public:
267
277
  DUCKDB_API explicit SerializationException(const string &msg);
@@ -201,6 +201,7 @@ public:
201
201
 
202
202
  //! Whether or not a sub-system can handle a specific file path
203
203
  DUCKDB_API virtual bool CanHandleFile(const string &fpath);
204
+ DUCKDB_API static IOException MissingFileException(const string &file_path, ClientContext &context);
204
205
 
205
206
  //! Set the file pointer of a file handle to a specified location. Reads and writes will happen from this location
206
207
  DUCKDB_API virtual void Seek(FileHandle &handle, idx_t location);