-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add INT8 type #1994
Merged
Merged
Add INT8 type #1994
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from,to,YEAR,Places,length | ||
0,1,2021,"[wwAewsdndweusd,wek]",5 | ||
2,1,2020,"[anew,jsdnwusklklklwewsd]",55 | ||
8,1,2020,"[awndsnjwejwen,isuhuwennjnuhuhuwewe]",22 | ||
from,to,YEAR,Places,length,level | ||
0,1,2021,"[wwAewsdndweusd,wek]",5,5 | ||
2,1,2020,"[anew,jsdnwusklklklwewsd]",55,120 | ||
8,1,2020,"[awndsnjwejwen,isuhuwennjnuhuhuwewe]",22,2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
create node table person (ID INt64, fName StRING, gender INT64, isStudent BoOLEAN, isWorker BOOLEAN, age INT64, eyeSight DOUBLE, birthdate DATE, registerTime TIMESTAMP, lastJobDuration interval, workedHours INT64[], usedNames STRING[], courseScoresPerTerm INT64[][], grades INT64[4], height float, PRIMARY KEY (ID)); | ||
create node table organisation (ID INT64, name STRING, orgCode INT64, mark DOUBLE, score INT64, history STRING, licenseValidInterval INTERVAL, rating DOUBLE, state STRUCT(revenue INT16, location STRING[], stock STRUCT(price INT64[], volume INT64)), info UNION(price FLOAT, movein DATE, note STRING),PRIMARY KEY (ID)); | ||
create node table movies (name STRING, length INT32, note STRING, description STRUCT(rating DOUBLE, views INT64, release TIMESTAMP, film DATE), content BYTEA, audience MAP(STRING, INT64), grade union(credit boolean, grade1 double, grade2 int64), PRIMARY KEY (name)); | ||
create node table movies (name STRING, length INT32, note STRING, description STRUCT(rating DOUBLE, stars INT8, views INT64, release TIMESTAMP, film DATE), content BYTEA, audience MAP(STRING, INT64), grade union(credit boolean, grade1 double, grade2 int64), PRIMARY KEY (name)); | ||
create rel table knows (FROM person TO person, date DATE, meetTime TIMESTAMP, validInterval INTERVAL, comments STRING[], MANY_MANY); | ||
create rel table studyAt (FROM person TO organisation, year INT64, places STRING[], length INT16,MANY_ONE); | ||
create rel table studyAt (FROM person TO organisation, year INT64, places STRING[], length INT16, level INT8, MANY_ONE); | ||
create rel table workAt (FROM person TO organisation, year INT64, grading DOUBLE[2], rating float, MANY_ONE); | ||
create rel table meets (FROM person TO person, location FLOAT[2], times INT, data BYTEA, MANY_ONE); | ||
create rel table marries (FROM person TO person, usedAddress STRING[], address INT16[2], note STRING, ONE_ONE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Sóló cón tu párejâ,126, this is a very very good movie,"{rating: 5.3, views: 152, release: 2011-08-20 11:25:30, film: 2012-05-11}","\\xAA\\xABinteresting\\x0B","{audience1= 52,audience53= 42}",true | ||
The 😂😃🧘🏻♂️🌍🌦️🍞🚗 movie,2544, the movie is very very good,"{rating: 7, views: 982, release: 2018-11-13 13:33:11, film: 2014-09-12}","\\xAB\\xCD",{audience1= 33},8.989 | ||
Roma,298,the movie is very interesting and funny,"{rating: 1223, views: 10003, release: 2011-02-11 16:44:22, film: 2013-02-22}","pure ascii characters","{}",254 | ||
Sóló cón tu párejâ,126, this is a very very good movie,"{rating: 5.3, stars:2, views: 152, release: 2011-08-20 11:25:30, film: 2012-05-11}","\\xAA\\xABinteresting\\x0B","{audience1= 52,audience53= 42}",true | ||
The 😂😃🧘🏻♂️🌍🌦️🍞🚗 movie,2544, the movie is very very good,"{rating: 7, stars:10, views: 982, release: 2018-11-13 13:33:11, film: 2014-09-12}","\\xAB\\xCD",{audience1= 33},8.989 | ||
Roma,298,the movie is very interesting and funny,"{rating: 1223, stars:100, views: 10003, release: 2011-02-11 16:44:22, film: 2013-02-22}","pure ascii characters","{}",254 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,8 @@ | |
return Value((int32_t)0); | ||
case LogicalTypeID::INT16: | ||
return Value((int16_t)0); | ||
case LogicalTypeID::INT8: | ||
return Value((int8_t)0); | ||
case LogicalTypeID::BOOL: | ||
return Value(true); | ||
case LogicalTypeID::DOUBLE: | ||
|
@@ -106,6 +108,11 @@ | |
val.booleanVal = val_; | ||
} | ||
|
||
Value::Value(int8_t val_) : isNull_{false} { | ||
dataType = std::make_unique<LogicalType>(LogicalTypeID::INT8); | ||
val.int8Val = val_; | ||
} | ||
|
||
Value::Value(int16_t val_) : isNull_{false} { | ||
dataType = std::make_unique<LogicalType>(LogicalTypeID::INT16); | ||
val.int16Val = val_; | ||
|
@@ -192,6 +199,9 @@ | |
case LogicalTypeID::INT16: { | ||
val.int16Val = *((int16_t*)value); | ||
} break; | ||
case LogicalTypeID::INT8: { | ||
val.int8Val = *((int8_t*)value); | ||
} break; | ||
case LogicalTypeID::BOOL: { | ||
val.booleanVal = *((bool*)value); | ||
} break; | ||
|
@@ -255,6 +265,9 @@ | |
case PhysicalTypeID::INT16: { | ||
val.int16Val = other.val.int16Val; | ||
} break; | ||
case PhysicalTypeID::INT8: { | ||
val.int8Val = other.val.int8Val; | ||
} break; | ||
case PhysicalTypeID::DOUBLE: { | ||
val.doubleVal = other.val.doubleVal; | ||
} break; | ||
|
@@ -297,6 +310,8 @@ | |
return TypeUtils::toString(val.int32Val); | ||
case LogicalTypeID::INT16: | ||
return TypeUtils::toString(val.int16Val); | ||
case LogicalTypeID::INT8: | ||
return TypeUtils::toString(val.int8Val); | ||
case LogicalTypeID::DOUBLE: | ||
return TypeUtils::toString(val.doubleVal); | ||
case LogicalTypeID::FLOAT: | ||
|
@@ -502,6 +517,9 @@ | |
case PhysicalTypeID::INT16: { | ||
SerDeser::serializeValue(val.int16Val, fileInfo, offset); | ||
} break; | ||
case PhysicalTypeID::INT8: { | ||
SerDeser::serializeValue(val.int8Val, fileInfo, offset); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep switch cases in this file, they are used for literalExpression in UDF. You don't need to add a test for this. |
||
} break; | ||
case PhysicalTypeID::DOUBLE: { | ||
SerDeser::serializeValue(val.doubleVal, fileInfo, offset); | ||
} break; | ||
|
@@ -549,6 +567,9 @@ | |
case PhysicalTypeID::INT16: { | ||
SerDeser::deserializeValue(val->val.int16Val, fileInfo, offset); | ||
} break; | ||
case PhysicalTypeID::INT8: { | ||
SerDeser::deserializeValue(val->val.int8Val, fileInfo, offset); | ||
} break; | ||
case PhysicalTypeID::DOUBLE: { | ||
SerDeser::deserializeValue(val->val.doubleVal, fileInfo, offset); | ||
} break; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for exception handling, keep this.