Skip to content

space() with negative input causes native crash #3326

@andygrove

Description

@andygrove

Description

Calling space(-1) (or any negative input) through Comet's native execution causes a crash with:

failed to round upto multiple of 64

Spark returns an empty string for space(-1).

Steps to Reproduce

CREATE TABLE test_space(n int) USING parquet;
INSERT INTO test_space VALUES (-1);
SELECT concat('[', space(n), ']') FROM test_space;

Expected Behavior

Should return [] (empty string padded), matching Spark behavior.

Actual Behavior

Native execution crashes with "failed to round upto multiple of 64".

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions