Skip to content

Commit

Permalink
replaced sqlContext with sparkSessesion
Browse files Browse the repository at this point in the history
  • Loading branch information
nasirali1 committed Jun 26, 2020
1 parent a398aa3 commit 74b64e5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cerebralcortex/algorithms/utils/mprov_helper.py
Expand Up @@ -47,7 +47,8 @@ def CC_MProvAgg(in_stream_name,op,out_stream_name,in_stream_key=['index'],out_st
connection_key = MProvConnectionCache.Key(user=os.getenv("MPROV_USER"), password=os.getenv("MPROV_PASSWORD"),
host=os.getenv("MPROV_HOST"), graph=graph_name)
mprov_conn = MProvConnectionCache.get_connection(connection_key)
mprov_conn.create_or_reset_graph()
if mprov_conn:
mprov_conn.create_or_reset_graph()
return MProvAgg(in_stream_name=in_stream_name, op=op, out_stream_name=out_stream_name, in_stream_key=in_stream_key, out_stream_key=out_stream_key, map=map, connection_key=connection_key)
else:
return MProvAgg_empty()
2 changes: 1 addition & 1 deletion cerebralcortex/core/config_manager/default.yml
Expand Up @@ -43,7 +43,7 @@ visualization_storage: none
#########################################################################
# Data Provenance Storage #
#########################################################################
mprov: pennprov
mprov: none

pennprov:
host: http://127.0.0.1:8088
Expand Down
5 changes: 3 additions & 2 deletions cerebralcortex/core/util/spark_helper.py
Expand Up @@ -56,14 +56,15 @@ def get_or_create_sc(type="sparkContext", name="CerebralCortex-Kernal", enable_s
sc.setLogLevel("ERROR")


sqlContext = SQLContext(sc)
#sqlContext = SQLContext(sc)

if type=="SparkSessionBuilder":
return sc
elif type=="sparkContext":
return sc
elif type=="sparkSession":
return sparkSession
elif type=="sqlContext":
return sqlContext
return sparkSession
else:
raise ValueError("Unknown type.")
5 changes: 4 additions & 1 deletion setup.py
Expand Up @@ -40,6 +40,9 @@

version='3.2.1r4',

package_data={'': ['default.yml']},
include_package_data=True,

description='Backend data analytics platform for MD2K software',
long_description=long_description,

Expand Down Expand Up @@ -85,5 +88,5 @@
]
},

#data_files=[('/etc/rsyslog.d', ['cerebralcortex/core/resources/20-cerebralcortex.conf']), ('/etc/logrotate.d', ['cerebralcortex/core/resources/cerebralcortex']),]
data_files=[('/etc/rsyslog.d', ['cerebralcortex/core/resources/20-cerebralcortex.conf']), ('/etc/logrotate.d', ['cerebralcortex/core/resources/cerebralcortex']),]
)

0 comments on commit 74b64e5

Please sign in to comment.