From a7f49cca27f46bad0ca2bbca7f745ffd5927aea4 Mon Sep 17 00:00:00 2001 From: Marios Trivyzas Date: Wed, 16 Jan 2019 13:57:11 +0200 Subject: [PATCH 1/2] SQL: [Docs] Add an ES-SQL column for data types 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 --- .../sql/language/data-types.asciidoc | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/docs/reference/sql/language/data-types.asciidoc b/docs/reference/sql/language/data-types.asciidoc index a4a407f175e17..4cb2016690f90 100644 --- a/docs/reference/sql/language/data-types.asciidoc +++ b/docs/reference/sql/language/data-types.asciidoc @@ -7,39 +7,40 @@ beta[] Most of {es} <> are available in {es-sql}, as indicated below: -[cols="^,^m,^"] +[cols="^,^m,^,^"] |=== s|{es} type +s|{es}-SQL type s|SQL type s|SQL precision -3+h| Core types - -| <> | null | 0 -| <> | boolean | 1 -| <> | tinyint | 3 -| <> | smallint | 5 -| <> | integer | 10 -| <> | bigint | 19 -| <> | double | 15 -| <> | real | 7 -| <> | float | 16 -| <> | float | 19 -| <> | varchar | based on <> -| <> | varchar | 2,147,483,647 -| <> | varbinary | 2,147,483,647 -| <> | timestamp | 24 -| <> | varchar | 39 - -3+h| Complex types - -| <> | struct | 0 -| <> | struct | 0 - -3+h| Unsupported types - -| _types not mentioned above_ | unsupported | 0 +4+h| Core types + +| <> | null | NULL | 0 +| <> | boolean | BOOLEAN | 1 +| <> | byte | TINYINT | 3 +| <> | short | SMALLINT | 5 +| <> | integer | INTEGER | 10 +| <> | long | BIGINT | 19 +| <> | double | DOUBLE | 15 +| <> | float | REAL | 7 +| <> | half_float | FLOAT | 16 +| <> | scaled_float | FLOAT | 19 +| <> | keyword | VARCHAR | based on <> +| <> | text | VARCHAR | 2,147,483,647 +| <> | binary | VARBINARY | 2,147,483,647 +| <> | datetime | TIMESTAMP | 24 +| <> | ip | VARCHAR | 39 + +4+h| Complex types + +| <> | object | STRUCT | 0 +| <> | nested | STRUCT | 0 + +4+h| Unsupported types + +| _types not mentioned above_ | unsupported | OTHER | 0 |=== From e5b94423689b06f8829392c21ca7e76174ce4056 Mon Sep 17 00:00:00 2001 From: Marios Trivyzas Date: Wed, 16 Jan 2019 15:36:57 +0200 Subject: [PATCH 2/2] Address comment --- docs/reference/sql/language/data-types.asciidoc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/reference/sql/language/data-types.asciidoc b/docs/reference/sql/language/data-types.asciidoc index 4cb2016690f90..60bdf0c5f66d3 100644 --- a/docs/reference/sql/language/data-types.asciidoc +++ b/docs/reference/sql/language/data-types.asciidoc @@ -5,13 +5,15 @@ beta[] -Most of {es} <> are available in {es-sql}, as indicated below: +Most of {es} <> are available in {es-sql}, as indicated below. +As one can see, all of {es} <> are mapped to the data type with the same +name in {es-sql}, with the exception of **date** data type which is mapped to **datetime** in {es-sql}: [cols="^,^m,^,^"] |=== s|{es} type -s|{es}-SQL type +s|{es-sql} type s|SQL type s|SQL precision