Converting data types¶
The below table shows all the allowed type conversions supported by BlazingSQL.
Types of conversion:
i - implicit cast
e - explicit cast
x - not allowed
FROM - TO |
|
|
|
|
|
|
|
|
|
|
|
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
i |
i |
i |
i |
i |
i |
i |
i |
i |
i |
i |
i |
|
x |
i |
e |
e |
e |
e |
e |
e |
e |
x |
x |
i |
|
x |
e |
i |
i |
i |
i |
i |
i |
i |
x |
e |
i |
|
x |
e |
i |
i |
i |
i |
i |
i |
i |
x |
e |
i |
|
x |
e |
i |
i |
i |
i |
i |
i |
i |
x |
e |
i |
|
x |
e |
i |
i |
i |
i |
i |
i |
i |
x |
e |
i |
|
x |
e |
i |
i |
i |
i |
i |
i |
i |
x |
e |
i |
|
x |
e |
i |
i |
i |
i |
i |
i |
i |
x |
e |
i |
|
x |
e |
i |
i |
i |
i |
i |
i |
i |
x |
e |
i |
|
x |
x |
x |
x |
x |
x |
x |
x |
x |
i |
i |
i |
|
x |
x |
e |
e |
e |
e |
e |
e |
e |
i |
i |
i |
|
x |
e |
i |
i |
i |
i |
i |
i |
i |
i |
i |
i |
TO_DATE
method¶
Casts a string to a date, allowing for formatting options. Formatting can be specified by using:
%Y
for year%m
for month%d
for day%H
for hour%M
for minute%S
for second
The syntax is of the form:
SELECT TO_DATE(<col>, <format_str>)
FROM <table>
Examples¶
SELECT TO_DATE(<col>, '%Y-%m-%d')
FROM <table>
TO_TIMESTAMP
method¶
Casts a string to a timestamp, allowing for formatting options. Formatting can be specified by using:
%Y
for year%m
for month%d
for day%H
for hour%M
for minute%S
for second
The syntax is of the form
SELECT TO_TIMESTAMP(<col>, <format_str>)
FROM <table>
Examples¶
SELECT TO_DATE(<col>, '%Y-%m-%d %H:%M:%S')
FROM <table>