Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace getUserFromAuthenticator because it is introduced in 0.13.
  • Loading branch information
dongjoon-hyun committed Mar 16, 2017
commit e8ef7d115ec34643c5af767298e20559f007aa33
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ private[hive] object HiveClientImpl {
hiveTable.setFields(schema.asJava)
}
hiveTable.setPartCols(partCols.asJava)
conf.foreach(c => hiveTable.setOwner(SessionState.getUserFromAuthenticator()))
conf.foreach(c => hiveTable.setOwner(SessionState.get().getAuthenticator().getUserName()))
Copy link
Member Author

Choose a reason for hiding this comment

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

We cannot use the following since it was introduced in 0.13.

conf.foreach(c => hiveTable.setOwner(SessionState.getUserFromAuthenticator()))

Copy link
Contributor

Choose a reason for hiding this comment

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

Since you're touching this, could you make it follow the usual style?

.foreach { c => ... }

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for review, @vanzin !
Which object do you mean for .foreach here?
For conf, we already use that.
For SessionState.get(), it's not Option.

Copy link
Contributor

Choose a reason for hiding this comment

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

There's only one foreach call and it's using a different style than the rest of the code.

Copy link
Member Author

@dongjoon-hyun dongjoon-hyun Mar 17, 2017

Choose a reason for hiding this comment

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

Oh, I see. It's about removing .foreach.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, it's about style. Parentheses v. braces.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah. Sorry again.

hiveTable.setCreateTime((table.createTime / 1000).toInt)
hiveTable.setLastAccessTime((table.lastAccessTime / 1000).toInt)
table.storage.locationUri.map(CatalogUtils.URIToString(_)).foreach { loc =>
Expand Down