Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement float(alias: REAL) dataType #1321

Merged
merged 1 commit into from
Feb 27, 2023
Merged

Implement float(alias: REAL) dataType #1321

merged 1 commit into from
Feb 27, 2023

Conversation

acquamarin
Copy link
Collaborator

@acquamarin acquamarin commented Feb 25, 2023

FLOAT (single precision floating-point number (4 bytes))

1. Grammar rule for defining FLOAT column:

To create a column with FLOAT datatype, simply declare the column as: COLUMN_NAME FLOAT

2. Adds aggregation/order by support for FLOAT.

3. Refactors the arithmetic operation framework:

We only define binary operations with both parameters having the same type.
For example:
We only define 3 operations for MOD operation:
INT64 % INT64,DOUBLE % DOUBLE,FLOAT % FLOAT
For other combinations of parameter types, we do casting.
For example: If we want to compute DOUBLE % INT64, we will convert INT64 to DOUBLE.

4. Implements to_float() function (converts an INT64 val to FLOAT).

dataset/tinysnb/schema.cypher Show resolved Hide resolved
src/common/type_utils.cpp Outdated Show resolved Hide resolved
src/common/types/value.cpp Outdated Show resolved Hide resolved
src/common/types/value.cpp Outdated Show resolved Hide resolved
src/common/types/value.cpp Show resolved Hide resolved
src/function/vector_arithmetic_operations.cpp Outdated Show resolved Hide resolved
src/function/vector_arithmetic_operations.cpp Outdated Show resolved Hide resolved
test/test_files/tinysnb/order_by/single_label.test Outdated Show resolved Hide resolved
test/test_files/tinysnb/order_by/single_label.test Outdated Show resolved Hide resolved
src/function/vector_cast_operations.cpp Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants