Created
March 4, 2020 00:29
-
-
Save mykidong/3a1df2824eb1b5c9300a3060f4713fe4 to your computer and use it in GitHub Desktop.
HiveRelationProvider.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.connector.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 HiveRelationProvider implements RelationProvider, DataSourceRegister { | |
@Override | |
public String shortName() { | |
return "hive-with-jdbc"; | |
} | |
@Override | |
public BaseRelation createRelation(SQLContext sqlContext, Map<String, String> parameters) { | |
return new HiveRelation(sqlContext, parameters); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment