You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The phone column in the test table contains the following data: ["123949", "sdkkd", "ppd23f", "56565652"]. I'm trying to delete the records that are not purely numeric and then convert the column to the BIGINT type. Here are the steps I followed:
First, I used DELETE FROM test WHERE NOT regexp_matches(phone, '^\d{1,}$'); to delete the non-numeric records.
Then I used SELECT * FROM test; to check the results after the deletion, and I can only see only the numbers remaining.
Finally, I used ALTER TABLE test ALTER phone TYPE BIGINT; try to convert the column type to BIGINT. However, I received an error message: Conversion Error: Could not convert string 'sdkkd' to INT64.
At first, I thought the DELETE operation didn't fully take effect, but even after disconnecting and reconnecting the data, the same error still occurred.
I'm not sure what the problem is.
To Reproduce
CREATETABLEtest (
phone VARCHAR(10)
);
INSERT INTO test (phone) VALUES
('123949'),
('sdkkd'),
('ppd23f'),
('56565652');
-- To delete the non-numeric recordsDELETEFROM test WHERE NOT regexp_matches(phone, '^\d{1,}$');
-- To check the resultsSELECT*FROM test;
-- Try to convert the column type to `BIGINT`ALTERTABLE test ALTER phone TYPE BIGINT;
-- SQL error: Conversion Error: Could not convert string 'sdkkd' to INT64
OS:
WIN_x64
DuckDB Version:
v0.10.2
DuckDB Client:
DBEAVER
Full Name:
john
Affiliation:
ignore
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
Yes
Did you include all code required to reproduce the issue?
Yes, I have
Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?
Yes, I have
The text was updated successfully, but these errors were encountered:
What happens?
The
phone
column in thetest
table contains the following data: ["123949", "sdkkd", "ppd23f", "56565652"]. I'm trying to delete the records that are not purely numeric and then convert the column to theBIGINT
type. Here are the steps I followed:DELETE FROM test WHERE NOT regexp_matches(phone, '^\d{1,}$');
to delete the non-numeric records.SELECT * FROM test;
to check the results after the deletion, and I can only see only the numbers remaining.ALTER TABLE test ALTER phone TYPE BIGINT;
try to convert the column type toBIGINT
. However, I received an error message:Conversion Error: Could not convert string 'sdkkd' to INT64.
At first, I thought the DELETE operation didn't fully take effect, but even after disconnecting and reconnecting the data, the same error still occurred.
I'm not sure what the problem is.
To Reproduce
OS:
WIN_x64
DuckDB Version:
v0.10.2
DuckDB Client:
DBEAVER
Full Name:
john
Affiliation:
ignore
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
Yes
Did you include all code required to reproduce the issue?
Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?
The text was updated successfully, but these errors were encountered: