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

[CORE] Import JDBC module #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wenfang6
Copy link
Collaborator

What changes were proposed in this pull request?

This PR imports JDBC module for XSQL, Creating class of JDBCManager and implementing some standard SQL functions. It works with some common jdbc data sources.

How was this patch tested?

No UT.

@wenfang6 wenfang6 changed the title import JDBC module [CORE] Import JDBC module Oct 18, 2019
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.spark.sql.xsql.manager
Copy link
Collaborator

Choose a reason for hiding this comment

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

blank

def this() = {
this(null)
}

Copy link
Collaborator

@beliefer beliefer Oct 20, 2019

Choose a reason for hiding this comment

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

def this() = this(null)

@@ -675,7 +675,7 @@ private[xsql] class XSQLExternalCatalog(conf: SparkConf, hadoopConf: Configurati
case ELASTICSEARCH => CatalogTableType.TYPE
case MONGO => CatalogTableType.COLLECTION
case HBASE => CatalogTableType.HBASE
case MYSQL | ORACLE => CatalogTableType.JDBC
case MYSQL | JDBC => CatalogTableType.JDBC
case DRUID => CatalogTableType.JDBC
Copy link
Collaborator

Choose a reason for hiding this comment

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

case JDBC => CatalogTableType.JDBC ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I haven't moved mysql to the jdbc module in this PR. So l didn't remove MYSQL for MysqlManager could work normally.

@@ -24,7 +24,7 @@ package org.apache.spark.sql.xsql
object DataSourceType extends Enumeration {

type DataSourceType = Value
val HIVE, ELASTICSEARCH, MONGO, REDIS, MYSQL, KAFKA, HBASE, DRUID, ORACLE, EXTERNAL = Value
val HIVE, ELASTICSEARCH, MONGO, REDIS, JDBC, MYSQL, KAFKA, HBASE, DRUID, EXTERNAL = Value

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could remove MYSQL ?

@beliefer
Copy link
Collaborator

Could you make the description have more detail?

<artifactId>xsql-hive_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
Copy link
Collaborator

@beliefer beliefer Oct 20, 2019

Choose a reason for hiding this comment

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

Why there need the dependence xsql-hive ?

<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These dependencies are used for testing.l forgot to remove them.

def getUser: String = username
def getPwd: String = passwd
}

class MysqlDataSource(
private val name: String,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we remove MysqlDataSource ?

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.

2 participants