objByName#
- swordfish.function.objByName()#
DolphinDB parses script before execution. The parsing procedure checks if a variable has been defined locally. If not, it will throw an exception. Assume we execute a locally defined function at remote nodes and the function queries a shared table that exists at remote nodes but not at the local node. If we directly call the table name in SQL statements, the system will fail to parse.
To address this issue, we introduce function objByName which returns an object by name at runtime.
If sharedVar is not specified, the system searches in local variables before searching in shared variables. If sharedVar = true, the system only searches in shared variables; if sharedVar = false, the system only searches in local variables.