Skip to content

Commit 8932750

Browse files
authored
SQL: [Docs] Add an ES-SQL column for data types (#37529)
In order to distinguish the ES-SQL type from the standard SQL type add a new ES-SQL column that will make clear this distingstion, e.g.: datetime vs TIMSTAMP Fixes: #37519
1 parent 9d8afe6 commit 8932750

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

docs/reference/sql/language/data-types.asciidoc

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,44 @@
55

66
beta[]
77

8-
Most of {es} <<mapping-types, data types>> are available in {es-sql}, as indicated below:
8+
Most of {es} <<mapping-types, data types>> are available in {es-sql}, as indicated below.
9+
As one can see, all of {es} <<mapping-types, data types>> are mapped to the data type with the same
10+
name in {es-sql}, with the exception of **date** data type which is mapped to **datetime** in {es-sql}:
911

10-
[cols="^,^m,^"]
12+
[cols="^,^m,^,^"]
1113

1214
|===
1315
s|{es} type
16+
s|{es-sql} type
1417
s|SQL type
1518
s|SQL precision
1619

17-
3+h| Core types
18-
19-
| <<null-value, `null`>> | null | 0
20-
| <<boolean, `boolean`>> | boolean | 1
21-
| <<number, `byte`>> | tinyint | 3
22-
| <<number, `short`>> | smallint | 5
23-
| <<number, `integer`>> | integer | 10
24-
| <<number, `long`>> | bigint | 19
25-
| <<number, `double`>> | double | 15
26-
| <<number, `float`>> | real | 7
27-
| <<number, `half_float`>> | float | 16
28-
| <<number, `scaled_float`>> | float | 19
29-
| <<keyword, `keyword`>> | varchar | based on <<ignore-above>>
30-
| <<text, `text`>> | varchar | 2,147,483,647
31-
| <<binary, `binary`>> | varbinary | 2,147,483,647
32-
| <<date, `date`>> | timestamp | 24
33-
| <<ip, `ip`>> | varchar | 39
34-
35-
3+h| Complex types
36-
37-
| <<object, `object`>> | struct | 0
38-
| <<nested, `nested`>> | struct | 0
39-
40-
3+h| Unsupported types
41-
42-
| _types not mentioned above_ | unsupported | 0
20+
4+h| Core types
21+
22+
| <<null-value, `null`>> | null | NULL | 0
23+
| <<boolean, `boolean`>> | boolean | BOOLEAN | 1
24+
| <<number, `byte`>> | byte | TINYINT | 3
25+
| <<number, `short`>> | short | SMALLINT | 5
26+
| <<number, `integer`>> | integer | INTEGER | 10
27+
| <<number, `long`>> | long | BIGINT | 19
28+
| <<number, `double`>> | double | DOUBLE | 15
29+
| <<number, `float`>> | float | REAL | 7
30+
| <<number, `half_float`>> | half_float | FLOAT | 16
31+
| <<number, `scaled_float`>> | scaled_float | FLOAT | 19
32+
| <<keyword, `keyword`>> | keyword | VARCHAR | based on <<ignore-above>>
33+
| <<text, `text`>> | text | VARCHAR | 2,147,483,647
34+
| <<binary, `binary`>> | binary | VARBINARY | 2,147,483,647
35+
| <<date, `date`>> | datetime | TIMESTAMP | 24
36+
| <<ip, `ip`>> | ip | VARCHAR | 39
37+
38+
4+h| Complex types
39+
40+
| <<object, `object`>> | object | STRUCT | 0
41+
| <<nested, `nested`>> | nested | STRUCT | 0
42+
43+
4+h| Unsupported types
44+
45+
| _types not mentioned above_ | unsupported | OTHER | 0
4346

4447
|===
4548

0 commit comments

Comments
 (0)