nsivabalan commented on a change in pull request #1858:
URL: https://github.com/apache/hudi/pull/1858#discussion_r458731792
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java
##########
@@ -151,6 +154,27 @@ public HoodieTableType getTableType() {
: Option.empty();
}
+ /**
+ * @return the table version from .hoodie properties file.
+ */
+ public HoodieTableVersion getHoodieTableVersionFromPropertyFile() {
+ if (props.contains(HOODIE_TABLE_VERSION_PROP_NAME)) {
+ String propValue = props.getProperty(HOODIE_TABLE_VERSION_PROP_NAME);
+ if (propValue.equals(HoodieTableVersion.ZERO_SIX_ZERO.version)) {
+ return HoodieTableVersion.ZERO_SIX_ZERO;
+ }
+ }
+ return DEFAULT_TABLE_VERSION;
+ }
+
+ /**
+ * @return the current hoodie table version.
+ */
+ public HoodieTableVersion getCurrentHoodieTableVersion() {
+ // TODO: fetch current version dynamically
Review comment:
let try to rephrase. Lets say a dataset was created in 0.6.0 and then
user moves to hoodie version 0.6.1 and when he launches hoodie for first time,
how in this code we will get to know that this is using version 0.6.1?
hoodie.properties will be having 0.6.0 only right.
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java
##########
@@ -151,6 +154,27 @@ public HoodieTableType getTableType() {
: Option.empty();
}
+ /**
+ * @return the table version from .hoodie properties file.
+ */
+ public HoodieTableVersion getHoodieTableVersionFromPropertyFile() {
+ if (props.contains(HOODIE_TABLE_VERSION_PROP_NAME)) {
+ String propValue = props.getProperty(HOODIE_TABLE_VERSION_PROP_NAME);
+ if (propValue.equals(HoodieTableVersion.ZERO_SIX_ZERO.version)) {
+ return HoodieTableVersion.ZERO_SIX_ZERO;
+ }
+ }
+ return DEFAULT_TABLE_VERSION;
+ }
+
+ /**
+ * @return the current hoodie table version.
+ */
+ public HoodieTableVersion getCurrentHoodieTableVersion() {
+ // TODO: fetch current version dynamically
Review comment:
let me try to rephrase. Lets say a dataset was created in 0.6.0 and then
user moves to hoodie version 0.6.1 and when he launches hoodie for first time,
how in this code we will get to know that this is using version 0.6.1?
hoodie.properties will be having 0.6.0 only right.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]