pyspark使用hbase详解

pyspark使用hbase详解

一、测试代码:

def write2hbase():
    from pyspark.sql import SparkSession
    from pyspark import SparkContext, SparkConf

    spark = SparkSession.builder.appName("nlp").getOrCreate()  # 创建spark对象
    print('spark对象已创建')
    host = 'emr1:2181,emr2:2181,emr3:2181'
    table = 'article_test'
    keyConv = "org.apache.spark.examples.pythonconverters.StringToImmutableBytesWritableConverter"
    valueConv = "org.apache.spark.examples.pythonconverters.StringListToPutConverter"
    conf = {
   

你可能感兴趣的:(python,python,pyspark,hbase)