[jira] [Updated] (IGNITE-20311) Sql. Fix behaviour of ROUND function.

2023-10-23 Thread Konstantin Orlov (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konstantin Orlov updated IGNITE-20311:
--
Ignite Flags: Release Notes Required  (was: Docs Required,Release Notes 
Required)

> Sql. Fix behaviour of ROUND function.
> -
>
> Key: IGNITE-20311
> URL: https://issues.apache.org/jira/browse/IGNITE-20311
> Project: Ignite
>  Issue Type: Bug
>  Components: sql
>Reporter: Maksim Zhuravkov
>Assignee: Maksim Zhuravkov
>Priority: Minor
>  Labels: ignite-3
> Fix For: 3.0.0-beta2
>
>  Time Spent: 4h 40m
>  Remaining Estimate: 0h
>
> The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
> causes issues when reading data from a `BinaryTuple` because this way 
> ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):
> {code}
>   SELECT ROUND(1.7)
>   # Although the implementation of the round function produces 2, RowSchema 
> has NativeType (precision=2, scale=1).
>   # Because of that this query returns 2.0 
> {code}
> Implementation we agreed upon:
> - For `ROUND(N)` return DECIMAL(p, 0) where p is precision of N's type.
> - For `ROUND(N, s)` return DECIMAL(p, derived_s) where where p is precision 
> of N's type, and derived_s is scale of N's type.
> Examples:
> {code}
> # ROUND(N):
> SELECT ROUND(1.1) 
> # Returns 1, Type: DECIMAL(p, 0)
> # ROUND(N, s):
> SELECT ROUND(1.123, s) FROM (VALUES (0), (1), (2), (3), (4) ) t(s)
> # Returns
> # 1.000
> # 1.100
> # 1.120
> # 1.123
> # 1.123
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (IGNITE-20311) Sql. Fix behaviour of ROUND function.

2023-10-17 Thread Yury Gerzhedovich (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yury Gerzhedovich updated IGNITE-20311:
---
Description: 
The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
causes issues when reading data from a `BinaryTuple` because this way 
ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):

{code}
  SELECT ROUND(1.7)
  # Although the implementation of the round function produces 2, RowSchema has 
NativeType (precision=2, scale=1).
  # Because of that this query returns 2.0 
{code}

Implementation we agreed upon:

- For `ROUND(N)` return DECIMAL(p, 0) where p is precision of N's type.
- For `ROUND(N, s)` return DECIMAL(p, derived_s) where where p is precision of 
N's type, and derived_s is scale of N's type.

Examples:

{code}
# ROUND(N):
SELECT ROUND(1.1) 
# Returns 1, Type: DECIMAL(p, 0)

# ROUND(N, s):
SELECT ROUND(1.123, s) FROM (VALUES (0), (1), (2), (3), (4) ) t(s)
# Returns
# 1.000
# 1.100
# 1.120
# 1.123
# 1.123
{code}




  was:
The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
causes issues when reading data from a `BinaryTuple` because this way 
ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):

{code}
  SELECT ROUND(1.7)
  # Although the implementation of the round function produces 2, RowSchema has 
NativeType (precision=2, scale=1).
  # Because of that this query returns 2.0 
{code}

Implementation we agreed upon:

- For `ROUND(N)` return DECIMAL(p, 0) where p is precision of N's type.
- For `ROUND(N, s)` return DECIMAL(p, derived_s) where where p is precision of 
N's type, and derived_s is scale of N's type.

Examples:

{code}
# ROUND(N):
SELECT ROUND(1.1) 
# Returns 1, Type: DECIMAL(p, 0)

# ROUND(N, s):
SELECT ROUND(1.123, s) FROM (VALUES (0), (1), (2), (3), (4) ) t(s)
# Returns
# 1
# 1.1
# 1.12
# 1.123
# 1.1230
{code}





> Sql. Fix behaviour of ROUND function.
> -
>
> Key: IGNITE-20311
> URL: https://issues.apache.org/jira/browse/IGNITE-20311
> Project: Ignite
>  Issue Type: Bug
>  Components: sql
>Reporter: Maksim Zhuravkov
>Assignee: Maksim Zhuravkov
>Priority: Minor
>  Labels: ignite-3
> Fix For: 3.0.0-beta2
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
> causes issues when reading data from a `BinaryTuple` because this way 
> ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):
> {code}
>   SELECT ROUND(1.7)
>   # Although the implementation of the round function produces 2, RowSchema 
> has NativeType (precision=2, scale=1).
>   # Because of that this query returns 2.0 
> {code}
> Implementation we agreed upon:
> - For `ROUND(N)` return DECIMAL(p, 0) where p is precision of N's type.
> - For `ROUND(N, s)` return DECIMAL(p, derived_s) where where p is precision 
> of N's type, and derived_s is scale of N's type.
> Examples:
> {code}
> # ROUND(N):
> SELECT ROUND(1.1) 
> # Returns 1, Type: DECIMAL(p, 0)
> # ROUND(N, s):
> SELECT ROUND(1.123, s) FROM (VALUES (0), (1), (2), (3), (4) ) t(s)
> # Returns
> # 1.000
> # 1.100
> # 1.120
> # 1.123
> # 1.123
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (IGNITE-20311) Sql. Fix behaviour of ROUND function.

2023-10-16 Thread Maksim Zhuravkov (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maksim Zhuravkov updated IGNITE-20311:
--
Description: 
The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
causes issues when reading data from a `BinaryTuple` because this way 
ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):

{code}
  SELECT ROUND(1.7)
  # Although the implementation of the round function produces 2, RowSchema has 
NativeType (precision=2, scale=1).
  # Because of that this query returns 2.0 
{code}

Implementation we agreed upon:

- For `ROUND(N)` return DECIMAL(p, 0) where p is precision of N's type.
- For `ROUND(N, s)` return DECIMAL(p, derived_s) where where p is precision of 
N's type, and derived_s is scale of N's type.

Examples:

{code}
# ROUND(N):
SELECT ROUND(1.1) 
# Returns 1, Type: DECIMAL(p, 0)

# ROUND(N, s):
SELECT ROUND(1.123, s) FROM (VALUES (0), (1), (2), (3), (4) ) t(s)
# Returns
# 1
# 1.1
# 1.12
# 1.123
# 1.1230
{code}




  was:
The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
causes issues when reading data from a `BinaryTuple` because this way 
ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):

{code}
  SELECT ROUND(1.7)
  # Although the implementation of the round function produces 2, RowSchema has 
NativeType (precision=2, scale=1).
  # Because of that this query returns 2.0 
{code}

Implementation we agreed upon:

- For `ROUND(N)` return DECIMAL(p, 0) where p is precision of N's type.
- For `ROUND(N, s)` return DECIMAL(p, derived_s) where where p is precision of 
N's type, and derived_s is scale of N's type.

Examples:

{code}
# ROUND(N):
SELECT ROUND(1.1) 
# Returns 1. Type: DECIMAL(p, 0)

# ROUND(N, s):
SELECT ROUND(1.123, s) FROM (VALUES (0), (1), (2), (3), (4) ) t(s)
# Returns
# 1
# 1.1
# 1.12
# 1.123
# 1.1230
{code}





> Sql. Fix behaviour of ROUND function.
> -
>
> Key: IGNITE-20311
> URL: https://issues.apache.org/jira/browse/IGNITE-20311
> Project: Ignite
>  Issue Type: Bug
>  Components: sql
>Reporter: Maksim Zhuravkov
>Assignee: Maksim Zhuravkov
>Priority: Minor
>  Labels: ignite-3
> Fix For: 3.0.0-beta2
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
> causes issues when reading data from a `BinaryTuple` because this way 
> ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):
> {code}
>   SELECT ROUND(1.7)
>   # Although the implementation of the round function produces 2, RowSchema 
> has NativeType (precision=2, scale=1).
>   # Because of that this query returns 2.0 
> {code}
> Implementation we agreed upon:
> - For `ROUND(N)` return DECIMAL(p, 0) where p is precision of N's type.
> - For `ROUND(N, s)` return DECIMAL(p, derived_s) where where p is precision 
> of N's type, and derived_s is scale of N's type.
> Examples:
> {code}
> # ROUND(N):
> SELECT ROUND(1.1) 
> # Returns 1, Type: DECIMAL(p, 0)
> # ROUND(N, s):
> SELECT ROUND(1.123, s) FROM (VALUES (0), (1), (2), (3), (4) ) t(s)
> # Returns
> # 1
> # 1.1
> # 1.12
> # 1.123
> # 1.1230
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (IGNITE-20311) Sql. Fix behaviour of ROUND function.

2023-10-16 Thread Maksim Zhuravkov (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maksim Zhuravkov updated IGNITE-20311:
--
Description: 
The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
causes issues when reading data from a `BinaryTuple` because this way 
ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):

{code}
  SELECT ROUND(1.7)
  # Although the implementation of the round function produces 2, RowSchema has 
NativeType (precision=2, scale=1).
  # Because of that this query returns 2.0 
{code}

Implementation we agreed upon:

- For `ROUND(N)` return DECIMAL(p, 0) where p is precision of N's type.
- For `ROUND(N, s)` return DECIMAL(p, derived_s) where where p is precision of 
N's type, and derived_s is scale of N's type.

Examples:

{code}
# ROUND(N):
SELECT ROUND(1.1) 
# Returns 1. Type: DECIMAL(p, 0)

# ROUND(N, s):
SELECT ROUND(1.123, s) FROM (VALUES (0), (1), (2), (3), (4) ) t(s)
# Returns
# 1
# 1.1
# 1.12
# 1.123
# 1.1230
{code}




  was:
The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
causes issues when reading data from a `BinaryTuple` because this way 
ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):

{code}
  SELECT ROUND(1.7)
  # Although the implementation of the round function produces 2, RowSchema has 
NativeType (precision=2, scale=1).
  # Because of that this query returns 2.0 
{code}

Implementation we agreed upon:

- For `ROUND(N)` return DECIMAL(p, 0) where p is precision of N's type.
- For `ROUND(N, s)` return DECIMAL(p, derived_s) where where p is precision of 
N's type, and derived_s is scale of N's type.

Examples:

{code}
# ROUND(N):
SELECT ROUND(1.1) 
# Returns 1. Type: DECIMAL(p, 0)

# ROUND(N, s):
SELECT ROUND(1.123, s) FROM (VALUES (0), (1), (2), (3), (4) ) t(s)
# Returns
# 1.000
# 1.100
# 1.120
# 1.123
# 1.1230
{code}





> Sql. Fix behaviour of ROUND function.
> -
>
> Key: IGNITE-20311
> URL: https://issues.apache.org/jira/browse/IGNITE-20311
> Project: Ignite
>  Issue Type: Bug
>  Components: sql
>Reporter: Maksim Zhuravkov
>Priority: Minor
>  Labels: ignite-3
> Fix For: 3.0.0-beta2
>
>
> The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
> causes issues when reading data from a `BinaryTuple` because this way 
> ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):
> {code}
>   SELECT ROUND(1.7)
>   # Although the implementation of the round function produces 2, RowSchema 
> has NativeType (precision=2, scale=1).
>   # Because of that this query returns 2.0 
> {code}
> Implementation we agreed upon:
> - For `ROUND(N)` return DECIMAL(p, 0) where p is precision of N's type.
> - For `ROUND(N, s)` return DECIMAL(p, derived_s) where where p is precision 
> of N's type, and derived_s is scale of N's type.
> Examples:
> {code}
> # ROUND(N):
> SELECT ROUND(1.1) 
> # Returns 1. Type: DECIMAL(p, 0)
> # ROUND(N, s):
> SELECT ROUND(1.123, s) FROM (VALUES (0), (1), (2), (3), (4) ) t(s)
> # Returns
> # 1
> # 1.1
> # 1.12
> # 1.123
> # 1.1230
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (IGNITE-20311) Sql. Fix behaviour of ROUND function.

2023-09-06 Thread Maksim Zhuravkov (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maksim Zhuravkov updated IGNITE-20311:
--
Description: 
The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
causes issues when reading data from a `BinaryTuple` because this way 
ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):

{code}
  SELECT ROUND(1.7)
  # Although the implementation of the round function produces 2, RowSchema has 
NativeType (precision=2, scale=1).
  # Because of that this query returns 2.0 
{code}

Implementation we agreed upon:

- For `ROUND(N)` return DECIMAL(p, 0) where p is precision of N's type.
- For `ROUND(N, s)` return DECIMAL(p, derived_s) where where p is precision of 
N's type, and derived_s is scale of N's type.

Examples:

{code}
# ROUND(N):
SELECT ROUND(1.1) 
# Returns 1. Type: DECIMAL(p, 0)

# ROUND(N, s):
SELECT ROUND(1.123, s) FROM (VALUES (0), (1), (2), (3), (4) ) t(s)
# Returns
# 1.000
# 1.100
# 1.120
# 1.123
# 1.1230
{code}




  was:
The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
causes issues when reading data from a `BinaryTuple` because this way 
ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):

{code}
  SELECT ROUND(1.7)
  # Although the implementation of the round function produces 2, RowSchema has 
NativeType (precision=2, scale=1).
  # Because of that this query returns 2.0 
{code}
 


> Sql. Fix behaviour of ROUND function.
> -
>
> Key: IGNITE-20311
> URL: https://issues.apache.org/jira/browse/IGNITE-20311
> Project: Ignite
>  Issue Type: Bug
>  Components: sql
>Reporter: Maksim Zhuravkov
>Priority: Minor
>  Labels: ignite-3
> Fix For: 3.0.0-beta2
>
>
> The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
> causes issues when reading data from a `BinaryTuple` because this way 
> ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):
> {code}
>   SELECT ROUND(1.7)
>   # Although the implementation of the round function produces 2, RowSchema 
> has NativeType (precision=2, scale=1).
>   # Because of that this query returns 2.0 
> {code}
> Implementation we agreed upon:
> - For `ROUND(N)` return DECIMAL(p, 0) where p is precision of N's type.
> - For `ROUND(N, s)` return DECIMAL(p, derived_s) where where p is precision 
> of N's type, and derived_s is scale of N's type.
> Examples:
> {code}
> # ROUND(N):
> SELECT ROUND(1.1) 
> # Returns 1. Type: DECIMAL(p, 0)
> # ROUND(N, s):
> SELECT ROUND(1.123, s) FROM (VALUES (0), (1), (2), (3), (4) ) t(s)
> # Returns
> # 1.000
> # 1.100
> # 1.120
> # 1.123
> # 1.1230
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (IGNITE-20311) Sql. Fix behaviour of ROUND function.

2023-08-30 Thread Maksim Zhuravkov (Jira)


 [ 
https://issues.apache.org/jira/browse/IGNITE-20311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maksim Zhuravkov updated IGNITE-20311:
--
Summary: Sql. Fix behaviour of ROUND function.  (was: Sql. Handle return 
type of ROUND. )

> Sql. Fix behaviour of ROUND function.
> -
>
> Key: IGNITE-20311
> URL: https://issues.apache.org/jira/browse/IGNITE-20311
> Project: Ignite
>  Issue Type: Bug
>  Components: sql
>Reporter: Maksim Zhuravkov
>Priority: Minor
>  Labels: ignite-3
> Fix For: 3.0.0-beta2
>
>
> The return type for ROUND(N)/ROUND(N, s) is equal to the type of `N`, which 
> causes issues when reading data from a `BinaryTuple` because this way 
> ROUND(DECIMAL(2,1)) has return type DECIMAL(2,1):
> {code}
>   SELECT ROUND(1.7)
>   # Although the implementation of the round function produces 2, RowSchema 
> has NativeType (precision=2, scale=1).
>   # Because of that this query returns 2.0 
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)