Created
March 4, 2020 00:27
-
-
Save mykidong/a3824b3d4625a8d5cfcd2226c6185683 to your computer and use it in GitHub Desktop.
JdbcHiveRelationProvider.class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mykidong.datasources.jdbc.hive; | |
import org.apache.spark.sql.SQLContext; | |
import org.apache.spark.sql.sources.BaseRelation; | |
import org.apache.spark.sql.sources.DataSourceRegister; | |
import org.apache.spark.sql.sources.RelationProvider; | |
import scala.collection.immutable.Map; | |
public class JdbcHiveRelationProvider implements RelationProvider, DataSourceRegister { | |
@Override | |
public String shortName() { | |
return "jdbc-hive"; | |
} | |
@Override | |
public BaseRelation createRelation(SQLContext sqlContext, Map<String, String> parameters) { | |
JdbcHiveRelation jdbcHiveRelation = new JdbcHiveRelation(sqlContext, parameters); | |
return jdbcHiveRelation; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment