Skip to content

Follow-up to #6811: the auto-detection path still overwrites an explicitly supplied delimiter (two unguarded sites the fix did not sweep) #6946

Closed

Description

@ruispereira

Summary

The #6811 fix guarded the extension-based delimiter write but left the two writes in the auto-detection path unconditional. When the source file's extension is unknown, an explicitly supplied -delimiter / WITH delimiter = ... is still overwritten - now by a guessed separator rather than by null.

Found while validating #6811 against main. The fix is correct for exactly what #6811 reported; this is a sibling site in a different code path.

Where (HEAD 55e00aaa6)

All three options.put("delimiter", ...) sites in integration/src/main/java/com/arcadedb/integration/importer/SourceDiscovery.java. The one #6811 fixed, :262-266:

if ("csv".equalsIgnoreCase(knownFileType)) {
  // NEVER OVERWRITE THE USER'S `delimiter` OPTION WITH NULL: THE PER-ENTITY DELIMITER IS AN OVERRIDE, NOT A
  // MANDATORY VALUE, AND CLOBBERING IT MADE EVERY NON-COMMA CSV UNIMPORTABLE (ISSUE #6811)
  if (knownDelimiter != null)
    settings.options.put("delimiter", knownDelimiter);

The two that kept the old shape - :371-374, in the auto-detection branch:

if (format == null) {
  LogManager.instance()
      .log(this, Level.INFO, "Best separator candidate='%s' (all candidates=%s)", bestSeparator.getKey(), list);
  settings.options.put("delimiter", "" + bestSeparator.getKey());

and :448-451, the RDF branch:

if (allDelimitersAreTheSame) {
  // RDF
  settings.typeIdProperty = "id";
  settings.options.put("delimiter", "" + delimiters.getFirst());

Repro

Reached whenever getFileTypeByExtension yields nothing, so the extension branch is skipped and content sniffing runs - e.g. a .txt, .dat or extensionless file:

bin/arcadedb-importer.sh -url file://data.txt -database ./databases/x -delimiter ';'

The sniffer picks its own best separator and writes it over the user's ;. If the guess happens to match, nothing is visible; if it does not (a file whose comma count beats its semicolon count because commas appear inside values, which is exactly why someone chose ;), the whole line is parsed as one column, the same end state #6811 described.

The severity is lower than #6811 because a guess is often right where null never was, and because the user can usually rename the file to .csv to reach the now-guarded path.

Suggested fix

Give both sites the same guard the extension branch received: skip the write when settings.options already holds a user-supplied delimiter. A helper (putDelimiterIfAbsent) used by all three sites would keep them from drifting apart again, which is what happened here. Worth logging at INFO when a detected separator is discarded in favour of the user's, so the auto-detection log line does not read as authoritative.

Scope / confidence

Medium-high. Verified by inspection at this checkout: all three call sites enumerated above, one guarded and two not. I did not reproduce it end to end (the integration module was not part of the build I had set up), so the reachability argument rests on reading analyzeSourceContent's branch structure rather than on a run.

Activity

  1. added
    importer
    on Aug 31, 2026
  2. added this to the 26.9.1 milestone on Aug 31, 2026
  3. added
    in progress
    on Sep 3, 2026
  4. self-assigned this
    on Sep 3, 2026
  5. added a commit that references this issue on Sep 3, 2026
  6. lvca commented on Sep 3, 2026

    @lvca
    Member

    Fixed in #7090 (merged in main, will be in 26.9.1).

    The delimiter you pass explicitly (-delimiter, WITH delimiter = ';', or the per-entity -documentsDelimiter / -verticesDelimiter / -edgesDelimiter) now always wins over the one guessed from the file content, also for files without a .csv extension. The precedence is: per-entity delimiter, then the generic one, then the detected one.

    The delimiter is also resolved separately for each file of the same import, so a value set or detected for the documents file no longer affects the vertices or edges files.

    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  7. removed
    in progress
    on Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugimporter

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions