Jos*_*rra 3 azure azure-storage hdinsight apache-spark
是否可以通过运行在Azure HDInsight上的Spark应用程序执行此操作?我们正在使用Scala。
支持Azure Blob(通过WASB)。我不明白为什么不使用Azure Tables。
提前致谢
小智 6
您实际上可以从Spark中的表存储中读取内容,这是一个由Microsoft所做的项目,其工作原理是:
您可能不需要所有Hive东西,只需要root级的类即可:
您可以阅读如下内容:
import org.apache.hadoop.conf.Configuration
sparkContext.newAPIHadoopRDD(getTableConfig(tableName,account,key),
classOf[AzureTableInputFormat],
classOf[Text],
classOf[WritableEntity])
def getTableConfig(tableName : String, account : String, key : String): Configuration = {
val configuration = new Configuration()
configuration.set("azure.table.name", tableName)
configuration.set("azure.table.account.uri", account)
configuration.set("azure.table.storage.key", key)
configuration
}
Run Code Online (Sandbox Code Playgroud)
您将必须编写一个解码函数,以将WritableEntity转换为所需的Class。
它为我工作!
| 归档时间: |
|
| 查看次数: |
1798 次 |
| 最近记录: |