Exemplo n.º 1
0
    def __init__(self, spark):

        config = get_config()
        self.conf = config
        self.odata = config["original_database"]
        self.fdata = config["feature_database"]
        self.adata = config["aggregation_database"]
        if self.logLevel != 'debug':
            self.sparkSession = spark
            self.trading_calendar = config["calendar_table"]
            self.date_order, self.order_date = self.get_calendar()
        else:

            class Log:
                def sql(self, str):
                    """
                    :rtype: object
                    """
                    print(
                        "------------------command line start-------------------"
                    )
                    print("{0}{1}{2}".format("spark.sql(\"\"\"", str,
                                             "\"\"\")"))
                    print(
                        "------------------command line end---------------------"
                    )
                    return self

                def repartition(self, partions):
                    return self

                def createOrReplaceTempView(self, str):
                    return self

            self.sparkSession = Log()
Exemplo n.º 2
0
    def __init__(self, spark):

        config = get_config()
        self.conf = config
        self.odata = config["original_database"]
        self.fdata = config["feature_database"]
        self.adata = config["aggregation_database"]
        self.confIni = ConfigParser.ConfigParser()
        if self.logLevel != 'debug':
            self.conf_path = spark.conf.get('spark.finogeeks.sbs.conf.path')
            self.confIni.read([self.conf_path + "/conf/config.ini"])
            self.sparkSession = spark
            self.trading_calendar = config["calendar_table"]
            self.date_order, self.order_date = self.get_calendar()
        else:
            class Log:
                def sql(self, str):
                    """
                    :rtype: object
                    """
                    print("------------------command line start-------------------")
                    print("{0}{1}{2}".format("spark.sql(\"\"\"", str, "\"\"\").show()"))
                    print("------------------command line end---------------------")
                    return self

                def repartition(self, partions):
                    return self

                def createOrReplaceTempView(self, str):
                    return self

            self.sparkSession = Log()
            self.confIni.read(["../conf/config.ini"])
Exemplo n.º 3
0
 def __init__(self, spark):
     self.spark = spark
     config = get_config()
     self.conf = config
     self.odata = config["original_database"]
     self.fdata = config["feature_database"]
     self.trading_calendar = config["calendar_table"]
     self.date_order, self.order_date = self.get_calendar()
Exemplo n.º 4
0
    def __init__(self, spark):

        config = get_config()
        self.conf = config
        self.odata = config["original_database"]
        self.fdata = config["feature_database"]
        self.adata = config["aggregation_database"]
        self.confIni = ConfigParser.ConfigParser()
        self.conf_path = spark.conf.get('spark.finogeeks.sbs.conf.path')
        self.confIni.read([self.conf_path + "/conf/config.ini"])
        self.sparkSession = spark
        self.trading_calendar = config["calendar_table"]
        self.date_order, self.order_date = self.get_calendar()