All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.sqlserver.jdbc.spark.ConnectorFactory.scala Maven / Gradle / Ivy

Go to download

The Apache Spark Connector for SQL Server and Azure SQL is a high-performance connector that enables you to use transactional data in big data analytics and persists results for ad-hoc queries or reporting.

There is a newer version: 1.0.2
Show newest version
package com.microsoft.sqlserver.jdbc.spark

import java.sql.SQLException

/**
 * Connector factory returns the appropriate connector implementation
 * based on user preferences. For now we have 2 connectors
 * 1. SingleInstanceConnector that writes to a given SQL instance
 * 2. DataPoolConnector that write to data pools in SQL Server Big Data Clusters.
 */
object ConnectorFactory {
  /**
   * get returns the appropriate connector based on user option
   * dataPoolDataSource which indicates write to datapool
   * @param options user specified options
   */
  def get(options: SQLServerBulkJdbcOptions) : Connector = {
    if (!DataPoolUtils.isDataPoolScenario(options)) {
      return SingleInstanceConnector
    } else {
      return DataPoolConnector
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy