Yicong-Huang commented on code in PR #4386:
URL: https://github.com/apache/texera/pull/4386#discussion_r3108044572
##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/mysql/MySQLSourceOpDesc.scala:
##########
@@ -19,50 +19,38 @@
package org.apache.texera.amber.operator.source.sql.mysql
-import org.apache.texera.amber.core.executor.OpExecWithClassName
+import org.apache.texera.amber.core.tuple.Schema
import org.apache.texera.amber.core.virtualidentity.{ExecutionIdentity,
WorkflowIdentity}
-import org.apache.texera.amber.core.workflow.{OutputPort, PhysicalOp,
SchemaPropagationFunc}
+import org.apache.texera.amber.core.workflow.{OutputPort, PhysicalOp}
import org.apache.texera.amber.operator.metadata.{OperatorGroupConstants,
OperatorInfo}
import org.apache.texera.amber.operator.source.sql.SQLSourceOpDesc
-import org.apache.texera.amber.operator.source.sql.mysql.MySQLConnUtil.connect
-import org.apache.texera.amber.util.JSONUtils.objectMapper
-import java.sql.{Connection, SQLException}
+import java.sql.Connection
+@deprecated("MySQL source is no longer executable; use PostgreSQLSource
instead.", "1.0.0")
class MySQLSourceOpDesc extends SQLSourceOpDesc {
override def getPhysicalOp(
workflowId: WorkflowIdentity,
executionId: ExecutionIdentity
): PhysicalOp =
- PhysicalOp
- .sourcePhysicalOp(
- workflowId,
- executionId,
- this.operatorIdentifier,
- OpExecWithClassName(
-
"org.apache.texera.amber.operator.source.sql.mysql.MySQLSourceOpExec",
- objectMapper.writeValueAsString(this)
- )
- )
- .withInputPorts(operatorInfo.inputPorts)
- .withOutputPorts(operatorInfo.outputPorts)
- .withPropagateSchema(
- SchemaPropagationFunc(_ => Map(operatorInfo.outputPorts.head.id ->
sourceSchema()))
- )
+ throw new UnsupportedOperationException(
+ "MySQL source operator is no longer executable. Replace this node with "
+
+ "PostgreSQLSource or another supported source."
Review Comment:
There is no way to replace this with Postgres operator. Recommend to use UDF?
##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/mysql/MySQLSourceOpDesc.scala:
##########
@@ -19,50 +19,38 @@
package org.apache.texera.amber.operator.source.sql.mysql
-import org.apache.texera.amber.core.executor.OpExecWithClassName
+import org.apache.texera.amber.core.tuple.Schema
import org.apache.texera.amber.core.virtualidentity.{ExecutionIdentity,
WorkflowIdentity}
-import org.apache.texera.amber.core.workflow.{OutputPort, PhysicalOp,
SchemaPropagationFunc}
+import org.apache.texera.amber.core.workflow.{OutputPort, PhysicalOp}
import org.apache.texera.amber.operator.metadata.{OperatorGroupConstants,
OperatorInfo}
import org.apache.texera.amber.operator.source.sql.SQLSourceOpDesc
-import org.apache.texera.amber.operator.source.sql.mysql.MySQLConnUtil.connect
-import org.apache.texera.amber.util.JSONUtils.objectMapper
-import java.sql.{Connection, SQLException}
+import java.sql.Connection
+@deprecated("MySQL source is no longer executable; use PostgreSQLSource
instead.", "1.0.0")
Review Comment:
It does not make sense to deprecate MySQL connector (source op) and
recommend use Postgres instead. They are completely different things.
##########
frontend/src/app/common/service/workflow-persist/workflow-persist.service.spec.ts:
##########
@@ -33,18 +33,18 @@ describe("WorkflowPersistService", () => {
"\"outputPorts\":[{\"portID\":\"output-0\",\"displayName\":null}],\"showAdvanced\":false},"
+
"{\"operatorID\":\"SimpleSink-operator-e4a77a32-e3c9-4c40-a26d-a1aa103cc914\",\"operatorType\":\"SimpleSink\","
+
"\"operatorProperties\":{},\"inputPorts\":[{\"portID\":\"input-0\",\"displayName\":\"\"}],\"outputPorts\":[],"
+
-
"\"showAdvanced\":false},{\"operatorID\":\"MySQLSource-operator-1ee619b1-8884-4564-a136-29ef77dfcc50\","
+
-
"\"operatorType\":\"MySQLSource\",\"operatorProperties\":{\"port\":\"default\",\"search\":false,\"progressive\":false,"
+
+
"\"showAdvanced\":false},{\"operatorID\":\"PostgreSQLSource-operator-1ee619b1-8884-4564-a136-29ef77dfcc50\","
+
Review Comment:
Why these changes?
##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/mysql/MySQLSourceOpDesc.scala:
##########
@@ -19,50 +19,38 @@
package org.apache.texera.amber.operator.source.sql.mysql
-import org.apache.texera.amber.core.executor.OpExecWithClassName
+import org.apache.texera.amber.core.tuple.Schema
import org.apache.texera.amber.core.virtualidentity.{ExecutionIdentity,
WorkflowIdentity}
-import org.apache.texera.amber.core.workflow.{OutputPort, PhysicalOp,
SchemaPropagationFunc}
+import org.apache.texera.amber.core.workflow.{OutputPort, PhysicalOp}
import org.apache.texera.amber.operator.metadata.{OperatorGroupConstants,
OperatorInfo}
import org.apache.texera.amber.operator.source.sql.SQLSourceOpDesc
-import org.apache.texera.amber.operator.source.sql.mysql.MySQLConnUtil.connect
-import org.apache.texera.amber.util.JSONUtils.objectMapper
-import java.sql.{Connection, SQLException}
+import java.sql.Connection
+@deprecated("MySQL source is no longer executable; use PostgreSQLSource
instead.", "1.0.0")
class MySQLSourceOpDesc extends SQLSourceOpDesc {
override def getPhysicalOp(
workflowId: WorkflowIdentity,
executionId: ExecutionIdentity
): PhysicalOp =
- PhysicalOp
- .sourcePhysicalOp(
- workflowId,
- executionId,
- this.operatorIdentifier,
- OpExecWithClassName(
-
"org.apache.texera.amber.operator.source.sql.mysql.MySQLSourceOpExec",
- objectMapper.writeValueAsString(this)
- )
- )
- .withInputPorts(operatorInfo.inputPorts)
- .withOutputPorts(operatorInfo.outputPorts)
- .withPropagateSchema(
- SchemaPropagationFunc(_ => Map(operatorInfo.outputPorts.head.id ->
sourceSchema()))
- )
+ throw new UnsupportedOperationException(
+ "MySQL source operator is no longer executable. Replace this node with "
+
+ "PostgreSQLSource or another supported source."
+ )
override def operatorInfo: OperatorInfo =
OperatorInfo(
- "MySQL Source",
- "Read data from a MySQL instance",
+ "MySQL Source (deprecated)",
Review Comment:
Do not change anything on desc. It will cause backward compatibility issue.
We can hide this operator on UI so user don't see it. But existing workflows
should still be able to load, (similar to what we did for sink.)
##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/mysql/MySQLConnUtil.scala:
##########
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.texera.amber.operator.source.sql.mysql
-
-import java.sql.{Connection, DriverManager, SQLException}
Review Comment:
Please minimize changes. Does this file also depend on MySQL lib?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]