Skip to content

Commit 1663c05

Browse files
committed
fixed bugs caused by --table-name flag and the version of the dependency
1 parent be4eb26 commit 1663c05

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
setup(
33
name = 'skyhookdmpy', # How you named your package folder (MyLib)
44
packages = ['skyhookdmpy'], # Chose the same as "name"
5-
version = '0.2.9', # Start with a small number and increase it with every change you make
5+
version = '0.3.1', # Start with a small number and increase it with every change you make
66
license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
77
description = 'Python client of Skyhook for Ceph', # Give a short description about your library
88
author = 'Xiaowei Chu', # Type in your name
99
author_email = 'xweichu@hotmail.com', # Type in your E-Mail
1010
url = 'https://github.com/uccross/skyhookdm-pythonclient', # Provide either the link to your github or to your website
11-
download_url = 'https://github.com/uccross/skyhookdm-pythonclient/archive/v0.2.7.tar.gz', # I explain this later on
11+
download_url = 'https://github.com/uccross/skyhookdm-pythonclient/archive/v0.3.1.tar.gz', # I explain this later on
1212
keywords = ['SkyhookDM', 'Skyhook', 'Skyhook-pythonclient'], # Keywords that define your package best
1313
install_requires=[ # I get to this in a second
1414
'pyarrow',
15-
'msgpack==0.6.2'
15+
'msgpack==0.6.2',
1616
'uproot',
1717
'bokeh',
1818
'wget',

skyhookdmpy/skyhook.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def getDataset(self, name):
8080

8181
def runQuery(self, obj, querystr):
8282
#limit just to 1 obj
83-
command_template = '--wthreads 1 --qdepth 120 --query hep --pool {} --start-obj #startobj --output-format \"SFT_PYARROW_BINARY\" --data-schema \"#dataschema\" --project \"#colname\" --num-objs #objnum --oid-prefix \"#prefix\" --subpartitions 10'.format(self.ceph_pool)
83+
command_template = '--wthreads 1 --qdepth 120 --query hep --pool {} --start-obj #startobj --output-format \"SFT_PYARROW_BINARY\" --data-schema \"#dataschema\" --project \"#colname\" --num-objs #objnum --oid-prefix \"#prefix\" --table-name \"#tablename\" --subpartitions 10'.format(self.ceph_pool)
8484

8585

8686
def generateQueryCommand(file, querystr):
@@ -92,7 +92,7 @@ def generateQueryCommand(file, querystr):
9292
for br in brs:
9393
br = br.strip()
9494
elems = br.split('.')
95-
br_name = elems[-1]
95+
br_name = elems[-1]
9696
elems.remove(br_name)
9797
local_prefix = ''
9898
for elem in elems:
@@ -129,6 +129,7 @@ def generateQueryCommand(file, querystr):
129129
cmd = cmd.replace('#dataschema', data_schema)
130130
cmd = cmd.replace('#colname', 'event_id,'+ br_name.strip())
131131
cmd = cmd.replace('#prefix', obj_prefix)
132+
cmd = cmd.replace('#tablename', br_name.strip())
132133
#limit the obj num to 1
133134
cmd = cmd.replace('#objnum', str(1))
134135
cmd = cmd.replace('#startobj', str(obj_num))

skyhookdmpy/skyhook_driver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def buildObj(dst_name, branch, subnode, obj_id):
4848
from collections import OrderedDict
4949
# change the name here to object_id which is the node_id
5050
# objname = branch.name.decode("utf-8")
51-
objname = '.' + str(obj_id)
51+
objname = '.' + str(branch.name) + '.' + str(obj_id)
5252
parent = subnode.parent
5353
while parent is not None:
5454
objname = parent.name + '#' + objname
@@ -160,7 +160,7 @@ def buildObj(dst_name, branch, subnode, obj_id):
160160
writer.write_batch(batch)
161161
buff = sink.getvalue()
162162
buff_bytes = buff.to_pybytes()
163-
ioctx.aio_write_full(objname + '.' + str(i), buff_bytes)
163+
ioctx.aio_write_full(x + '.' + str(i), buff_bytes)
164164
ioctx.set_xattr(objname + '.' + str(i), 'size', str(len(buff_bytes)))
165165
i += 1
166166
ioctx.close()

0 commit comments

Comments
 (0)