Github user JamesRTaylor commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/221#discussion_r87025450
--- Diff:
phoenix-spark/src/it/scala/org/apache/phoenix/spark/PhoenixSparkIT.scala ---
@@ -60,16 +60,21 @@ class PhoenixSparkIT extends FunSuite with Matchers
with BeforeAndAfterAll {
ConfigurationUtil.getZookeeperURL(hbaseConfiguration).get
}
- override def beforeAll() {
- PhoenixSparkITHelper.doSetup
+ // Runs SQL commands located in the file defined in the sqlSource
argument
+ // Optional argument tenantId used for running tenant-specific SQL
+ def setupTables(sqlSource: String, tenantId: Option[String]): Unit = {
+ val url = tenantId match {
+ case Some(tenantId) => PhoenixSparkITHelper.getUrl + ";TenantId=" +
tenantId
+ case _ => PhoenixSparkITHelper.getUrl
+ }
- conn = DriverManager.getConnection(PhoenixSparkITHelper.getUrl)
+ conn = DriverManager.getConnection(url)
--- End diff --
Better to set TenantId in Properties and use
DriverManager.getConnection(url, props) than muck with the URL string
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---