apache/seatunnel · warning

Skip deleting table directory because target path has no sep

Error message

Skip deleting table directory because target path has no separator: {}

What it means

When committing a non-partitioned Hive write, the committer tries to strip the last path segment from the target location to obtain the table directory and delete it. If the target path has no '/' or '\\' separator, the substring would be meaningless, so it logs this warning and skips the deletion instead of corrupting the path.

Source

Thrown at seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/commit/HiveSinkAggregatedCommitter.java:199

                continue;
            }

            try {
                // Get the first target path from transactionMap
                String targetPath =
                        transactionMap.values().stream()
                                .flatMap(m -> m.values().stream())
                                .findFirst()
                                .orElseThrow(
                                        () -> new IllegalStateException("No target paths found"));

                if (aggregatedCommitInfo.getPartitionDirAndValuesMap().isEmpty()) {
                    // For non-partitioned table, extract and delete table directory
                    // Example: hdfs://hadoop-master1:8020/warehouse/test_overwrite_1/
                    int lastSeparator =
                            Math.max(targetPath.lastIndexOf('/'), targetPath.lastIndexOf('\\'));
                    if (lastSeparator <= 0) {
                        log.warn(
                                "Skip deleting table directory because target path has no separator: {}",
                                targetPath);
                        continue;
                    }
                    String tableDir = targetPath.substring(0, lastSeparator);
                    if (deleteTargetDirectoryOnce(tableDir)) {
                        log.info("Deleted table directory: {}", tableDir);
                        anyDeleted = true;
                    }
                } else {
                    // For partitioned table, extract and delete partition directories
                    // Example:
                    // hdfs://hadoop-master1:8020/warehouse/test_overwrite_partition/age=26/
                    Set<String> partitionDirs =
                            transactionMap.values().stream()
                                    .flatMap(m -> m.values().stream())
                                    .map(
                                            path -> {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set the Hive sink target/location to a fully-qualified path including separators, e.g. hdfs://namenode:8020/warehouse/db.db/table
  2. Verify the table location in the Hive metastore is a proper URI rather than a bare string
  3. If the warning appears, manually clean up the stale table directory if overwrite semantics require it

Example fix

// before
"target_path" = "test_overwrite_1"
// after
"target_path" = "hdfs://hadoop-master1:8020/warehouse/test.db/test_overwrite_1"
Defensive patterns

Strategy: validation

Validate before calling

String p = targetPath;
if (p.lastIndexOf('/') <= 0 && p.lastIndexOf('\\') <= 0) {
  throw new IllegalArgumentException("target_path must be a full path with separators: " + p);
}

Prevention

When it happens

Trigger: HiveSinkAggregatedCommitter.deleteDirectories() (called from commit) processes a non-partitioned table whose aggregated targetPath contains no path separator (lastSeparator <= 0).

Common situations: Target configured as a bare relative name like 'test_overwrite_1' instead of a full URI such as hdfs://host:8020/warehouse/db.db/test_overwrite_1, or an odd filesystem path scheme.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/ab2ecddd4b79c984. Report an issue: GitHub.