Browse Source

bugfixe in ML

master
Ulrich Carmesin 2 years ago
parent
commit
092a67006c
  1. 3
      utils/dbshive_tool.py
  2. 2
      utils/file_tool.py

3
utils/dbshive_tool.py

@ -41,11 +41,14 @@ class DbFcts(utils.db_abstract.DbFcts):
for k in sqls.keys(): for k in sqls.keys():
sql = sqls[k] sql = sqls[k]
if dry == 1: if dry == 1:
try:
spark = self.getConnector() spark = self.getConnector()
df = spark.sql(sql) df = spark.sql(sql)
dfj = df.toJSON() dfj = df.toJSON()
for r in dfj.collect(): for r in dfj.collect():
data.append(json.loads(r)) data.append(json.loads(r))
except:
self.comp.m.setError("Table couldnt read "+table)
else: else:
print("select "+sql) print("select "+sql)
self.comp.m.logInfo(sql) self.comp.m.logInfo(sql)

2
utils/file_tool.py

@ -38,6 +38,8 @@ def getFiles(msg, path, pattern, conn):
verify = int(job.getDebugLevel("file_tool")) verify = int(job.getDebugLevel("file_tool"))
out = [] out = []
msg.debug(verify, "getFiles " + path + " , " + pattern) msg.debug(verify, "getFiles " + path + " , " + pattern)
if not os.path.exists(path):
return out
for f in os.listdir(path): for f in os.listdir(path):
msg.debug(verify, "getFiles " + f) msg.debug(verify, "getFiles " + f)
if re.search(pattern, f): if re.search(pattern, f):

Loading…
Cancel
Save