读取postgis数据源的都是相同的标准,理论上人大金仓的数据库没有大改postgresql内核的话,是可以支持的。
具体读取代码,可以参考如下示例:
val params = new java.util.HashMap[String, java.io.Serializable]()
params.put(JDBCFeatureRDDProviderParams.DBType.key, "postgis")
params.put(JDBCFeatureRDDProviderParams.Host.key, "127.0.0.1")
params.put(JDBCFeatureRDDProviderParams.Port.key, 5432)
params.put(JDBCFeatureRDDProviderParams.Schema.key, "public")
params.put(JDBCFeatureRDDProviderParams.DataBase.key, "zyldb")
params.put(JDBCFeatureRDDProviderParams.User.key, "zyl")
params.put(JDBCFeatureRDDProviderParams.PassWord.key, "supermap")
params.put(FeatureRDDProviderParams.ProviderType.key, "JDBC")
params.put(FeatureRDDProviderParams.NumPartitions.key, 4)
val tmp = FeatureRDDProviderFactory(params).rdd(new Configuration(), ss.sparkContext, params, new Query("mytestR"))