Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

table name is confused if both flags and property file set it #245

Open
sillydong opened this issue Aug 23, 2022 · 1 comment
Open

table name is confused if both flags and property file set it #245

sillydong opened this issue Aug 23, 2022 · 1 comment

Comments

@sillydong
Copy link
Contributor

Code

From function initialGlobal, we can see that global tableName variable is get from property file with field name table if it is empty
image
but in initClientCommand, there is a flag setting the global tableName variable, so when we set it in cmd flags, it will always has value when it goes into intialGlobal and check its length
image
and in all db implementations, they are using tableName from property file, take mysql as an example
image

Debug

./go-ycsb load mysql -P "my.properties,workloads/workloada" --table ddd --target 100 --threads 5

in workloads/workloada

table=ccc

global variable in main.go
image
variable in db implementation mysql
image

we can see they are different

More

By digging deeper, I found that the DB field defined in prop.go is not used anywhere. The db implementations are using dbName from global variable and is set by command flag, in the mean time, we can see that the real tableName takes effect is from property file, the different ways we set these two associated variables make user confuse.

Suggestion

We should make it clean and unique, either we set these two variables by cmd flags, or by property file.

@sillydong
Copy link
Contributor Author

@siddontang please also check this issue. It is not related to output style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant