Removing a type that is in the SQL standard is not practical.

The best way to deal with the confusion is to state the rules again. If there 
are a few inconsistencies in the code, fix the inconsistencies.

REAL is a 32 bit float (similar to Java float);
DOUBLE is a 64 bit float (similar to Java double);
Use of FLOAT is not recommended, but it is currently equivalent to DOUBLE.

> On Oct 26, 2023, at 2:51 PM, Paul Jackson 
> <[email protected]> wrote:
> 
> Doesn't having two types help distinguish which type is in the source 
> database for platforms that support both? A call to 
> org.apache.calcite.sql.type.SqlTypeName#getNameForJdbcType would lose that 
> distinction. I don't know offhand whether there are databases that require a 
> CAST when converting from double to float. Would that be important to know 
> before deciding?
> -Paul
>    On Thursday, October 26, 2023 at 02:02:50 PM EDT, Mihai Budiu 
> <[email protected]> wrote:  
> 
> Hello,
> 
> It turns out that there is a lot of confusion in Calcite about what FLOAT is.
> I have filed an issue about it: 
> https://issues.apache.org/jira/browse/CALCITE-6074
> 
> It seems that the intent is for FLOAT to be an exact alias of DOUBLE.
> If that's the case, we can remove a lot of code and prevent further 
> confusions by just removing FLOAT as a SqlTypeName and using DOUBLE 
> everywhere starting in the parser. The situation is very similar with DECIMAL 
> and NUMERIC.
> 
> This will also prevent a lot of bugs in third party code that uses Calcite, 
> since they cannot misinterpret what FLOAT is.
> 
> If you agree that this is the right thing, I will submit a PR which marks 
> FLOAT as @Deprecated and removes all its uses in the codebase.
> 
> Mihai
> 

Reply via email to