-
Notifications
You must be signed in to change notification settings - Fork 244
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
Allow TiSpark retrieve row id #367
Conversation
/run-all-tests |
/run-all-tests tikv=release-2.0 tidb=release-2.0 pd=release-2.0 |
/run-all-tests tikv=release-2.0 tidb=release-2.0 pd=release-2.0 |
val tiRelation = new TiDBRelation( | ||
tiSession, | ||
new TiTableReference(dbName, tableName), | ||
meta | ||
)(sqlContext) | ||
val df = sqlContext.baseRelationToDataFrame(tiRelation) | ||
df |
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.
df is not needed
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.
fixed
for (TiColumnInfo col : getColumns()) { | ||
DataType type = col.getType(); | ||
InternalTypeHolder typeHolder = type.toTypeHolder(); | ||
typeHolder.setFlag(type.getFlag() & (~DataType.PriKeyFlag)); |
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.
i think we should wrap this into a public function, and set PriKeyFlag protected.
@@ -63,7 +63,7 @@ | |||
protected final MySQLType tp; | |||
// Not Encode/Decode flag, this is used to strict mysql type | |||
// such as not null, timestamp | |||
protected final int flag; | |||
protected int flag; |
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.
final
Codecov Report
@@ Coverage Diff @@
## master #367 +/- ##
=========================================
Coverage ? 55.14%
=========================================
Files ? 127
Lines ? 5821
Branches ? 867
=========================================
Hits ? 3210
Misses ? 2316
Partials ? 295
Continue to review full report at Codecov.
|
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.
LGTM
For implicit primary key, allow TiSpark to retrieve row_id. It's controlled by switch and if turned on, user will be able to see this column and retrieve it.
This change is