[
https://issues.apache.org/jira/browse/GOBBLIN-1150?focusedWorklogId=434137&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-434137
]
ASF GitHub Bot logged work on GOBBLIN-1150:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 17/May/20 04:08
Start Date: 17/May/20 04:08
Worklog Time Spent: 10m
Work Description: sv2000 commented on a change in pull request #2988:
URL: https://github.com/apache/incubator-gobblin/pull/2988#discussion_r426214966
##########
File path:
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_store/MysqlSpecStore.java
##########
@@ -62,32 +62,34 @@
public class MysqlSpecStore implements SpecStore {
public static final String CONFIG_PREFIX = "mysqlSpecStore";
public static final String DEFAULT_TAG_VALUE = "";
+ private static final String NEW_COLUMN = "spec_json";
private static final String CREATE_TABLE_STATEMENT =
- "CREATE TABLE IF NOT EXISTS %s (spec_uri VARCHAR(128) NOT NULL, tag
VARCHAR(128) NOT NULL, spec LONGBLOB, PRIMARY KEY (spec_uri))";
- private static final String CREATE_TABLE_STATEMENT_V2 =
"CREATE TABLE IF NOT EXISTS %s (spec_uri VARCHAR(128) NOT NULL,
flow_group VARCHAR(128), flow_name VARCHAR(128), "
- + "template_uri VARCHAR(128), user_to_proxy VARCHAR(128),
source_identifier VARCHAR(128), destination_identifier VARCHAR(128), "
- + "schedule VARCHAR(128), tag VARCHAR(128) NOT NULL, modified_time
TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, "
- + "spec JSON, PRIMARY KEY (spec_uri))";
+ + "template_uri VARCHAR(128), user_to_proxy VARCHAR(128),
source_identifier VARCHAR(128), "
+ + "destination_identifier VARCHAR(128), schedule VARCHAR(128), tag
VARCHAR(128) NOT NULL, "
+ + "modified_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON
UPDATE CURRENT_TIMESTAMP, "
+ + "isRunImmediately BOOLEAN, timezone VARCHAR(128), owning_group
VARCHAR(128), "
+ + "spec LONGBLOB, " + NEW_COLUMN + " JSON, PRIMARY KEY (spec_uri))";
private static final String EXISTS_STATEMENT = "SELECT EXISTS(SELECT * FROM
%s WHERE spec_uri = ?)";
- private static final String INSERT_STATEMENT = "INSERT INTO %s (spec_uri,
tag, spec) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE spec = VALUES(spec)";
+ private static final String INSERT_STATEMENT = "INSERT INTO %s (spec_uri,
tag, spec, " + NEW_COLUMN + ") "
+ + "VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE spec = VALUES(spec), " +
NEW_COLUMN + " = VALUES(" + NEW_COLUMN + ")";
private static final String DELETE_STATEMENT = "DELETE FROM %s WHERE
spec_uri = ?";
- private static final String GET_STATEMENT = "SELECT spec FROM %s WHERE
spec_uri = ?";
- private static final String GET_ALL_STATEMENT = "SELECT spec_uri, spec FROM
%s";
- private static final String GET_ALL_STATEMENT_WITH_TAG = "SELECT spec_uri,
spec FROM %s WHERE tag = ?";
- static final String WRITE_TO_OLD_TABLE_KEY = "write.to.old.table";
- static final String READ_FROM_OLD_TABLE_KEY = "read.from.old.table";
+ private static final String GET_STATEMENT = "SELECT %s FROM %s WHERE
spec_uri = ?";
+ private static final String GET_ALL_STATEMENT = "SELECT spec_uri, %s FROM
%s";
+ private static final String GET_ALL_URIS_STATEMENT = "SELECT spec_uri FROM
%s";
+ private static final String GET_ALL_STATEMENT_WITH_TAG = "SELECT spec_uri
FROM %s WHERE tag = ?";
+ static final String WRITE_TO_OLD_COLUMN = "write.to.old.column";
Review comment:
Sorry - my earlier comment could have been clearer. Yeah, writes to both
columns is simpler. For read, we can check if the new column is not null and
read from the new column else default to the old column. Would be nice to avoid
having to pass configurations.
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 434137)
Time Spent: 1h 10m (was: 1h)
> change spec store table to use json type
> ----------------------------------------
>
> Key: GOBBLIN-1150
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1150
> Project: Apache Gobblin
> Issue Type: Improvement
> Reporter: Arjun Singh Bora
> Priority: Major
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)