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

Allow TiSpark retrieve row id #367

Merged
merged 8 commits into from
Jul 3, 2018
Merged

Allow TiSpark retrieve row id #367

merged 8 commits into from
Jul 3, 2018

Conversation

ilovesoup
Copy link
Contributor

@ilovesoup ilovesoup commented Jun 19, 2018

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 Reviewable

@ilovesoup
Copy link
Contributor Author

/run-all-tests

@Novemser
Copy link
Contributor

/run-all-tests tikv=release-2.0 tidb=release-2.0 pd=release-2.0

@Novemser
Copy link
Contributor

/run-all-tests tikv=release-2.0 tidb=release-2.0 pd=release-2.0

@ilovesoup ilovesoup changed the title Allow TiSpark to retrieve row id Allow TiSpark retrieve row id Jun 25, 2018
val tiRelation = new TiDBRelation(
tiSession,
new TiTableReference(dbName, tableName),
meta
)(sqlContext)
val df = sqlContext.baseRelationToDataFrame(tiRelation)
df
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

df is not needed

Copy link
Contributor Author

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));
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

final

@codecov-io
Copy link

codecov-io commented Jul 3, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@a54db4f). Click here to learn what that means.
The diff coverage is 23.71%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #367   +/-   ##
=========================================
  Coverage          ?   55.14%           
=========================================
  Files             ?      127           
  Lines             ?     5821           
  Branches          ?      867           
=========================================
  Hits              ?     3210           
  Misses            ?     2316           
  Partials          ?      295
Impacted Files Coverage Δ
...src/main/java/com/pingcap/tikv/meta/Collation.java 97.88% <ø> (ø)
...c/main/java/com/pingcap/tikv/meta/TiTableInfo.java 43.07% <0%> (ø)
...ient/src/main/java/com/pingcap/tikv/TiSession.java 68% <100%> (ø)
.../main/java/com/pingcap/tikv/types/IntegerType.java 61.7% <100%> (ø)
.../main/java/com/pingcap/tikv/meta/TiColumnInfo.java 51.96% <2.77%> (ø)
...rc/main/java/com/pingcap/tikv/catalog/Catalog.java 76.19% <37.5%> (ø)
...rc/main/java/com/pingcap/tikv/TiConfiguration.java 53.94% <50%> (ø)
...src/main/java/com/pingcap/tikv/types/DataType.java 65.71% <75%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a54db4f...7c82ab0. Read the comment docs.

Copy link
Contributor

@birdstorm birdstorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ilovesoup ilovesoup merged commit 3473f86 into master Jul 3, 2018
@ilovesoup ilovesoup deleted the show_row_id branch July 3, 2018 08:33
birdstorm pushed a commit that referenced this pull request Aug 24, 2018
birdstorm pushed a commit that referenced this pull request Aug 24, 2018
wfxxh pushed a commit to wanfangdata/tispark that referenced this pull request Jun 30, 2023
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.

4 participants