in phoenix5-spark3/src/main/scala/org/apache/phoenix/spark/ConfigurationUtil.scala [28:64]
def getOutputConfiguration(tableName: String, columns: Seq[String], zkUrl: Option[String], tenantId: Option[String] = None, conf: Option[Configuration] = None): Configuration = {
// Create an HBaseConfiguration object from the passed in config, if present
val config = conf match {
case Some(c) => HBaseFactoryProvider.getConfigurationFactory.getConfiguration(c)
case _ => HBaseFactoryProvider.getConfigurationFactory.getConfiguration()
}
// Set the tenantId in the config if present
tenantId match {
case Some(id) => setTenantId(config, id)
case _ =>
}
// Set the table to save to
PhoenixConfigurationUtil.setOutputTableName(config, tableName)
PhoenixConfigurationUtil.setPhysicalTableName(config, tableName)
// disable property provider evaluation
PhoenixConfigurationUtil.setPropertyPolicyProviderDisabled(config);
// Infer column names from the DataFrame schema
PhoenixConfigurationUtil.setUpsertColumnNames(config, Array(columns : _*))
// Override the Zookeeper URL if present. Throw exception if no address given.
zkUrl match {
case Some(url) => setZookeeperURL(config, url)
case _ => {
if (ConfigurationUtil.getZookeeperURL(config).isEmpty) {
throw new UnsupportedOperationException(
s"One of zkUrl or '${HConstants.ZOOKEEPER_QUORUM}' config property must be provided"
)
}
}
}
// Return the configuration object
config
}