How to resolve the Semantic error in ADX relop - azure-data-explorer

Semantic error: Relop semantic error: SEM0025: One of the values provided to the 'in' operator does not match the column 'vin' type 'string', consider using explicit cast

Related

typeError Cannot read property 'substr' of null

I have a dataframe "x" with words in the first column and numbers in the other columns, when trying to use the syntax:
X$secondcolumn
Get the error "typeError Cannot read property 'substr' of null", and the answer in R is:
NULL
I tried using the as.numeric function but didnt work.
as.numeric(x)
It says:
Error: 'list' object cannot be coerced to type 'double'
I need the values to be recognized as numbers to use for mathematical purposes but dont know how to do it.
Thanks

Kusto extract text between string

Am trying to use regex to extract a string between a set of strings. But Kusto complains about the regex expression as invalid.
Am trying to replicate the expression from this link in my kusto query.
traces
| where ....
| project extract_all(#"(?<=This is)(.*)(?=sentence)", message)
Kusto would complain this error..
Relop semantic error: 'extractall' has the following semantic error: SEM0420: Regex pattern is ill-formed: (?<=This is)(.*)(?=sentence).
If issue persists, please open a support ticket. Request id: 01b819be-2e11-4983-9312-30f946c07afb
Could someone please help me fix the syntax of the above regex for kusto?
as the error message suggests, the regular expression you're specifying as the argument to the extract_all() method is invalid.
from the documentation: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/re2
The regular expression syntax supported by Kusto is that of the re2 library.
If you were to provide a sample input and the matching expected output, it'd be easier to provide you with a functional and efficient solution.

Error in using contains() in filter command of dplyr

I am trying to filter the values of the column 2010. The actual column name is "Y2010". I know to get the output the easy way but i am trying to use the function contains() to fetch the values of the column Y2010 which are greater than 150000.
Code i used is:
filter(HistData, contains("2010")>150000)
This is not working. I am getting the following error:
Error in filter_impl(.data, quo) :
Evaluation error: No tidyselect variables were registered.
I couldn't understand what I am doing wrong.
This contains works fine when I use select command.
select(histdata,contains("2010").
Can anyone please explain what am I missing in the filter command.
This is due to the "select" helpers. I was using select command helpers like ends_with, contains etc in filter command.

infomatica unconnected lookup invalid symbol reference error

I am getting invalid symbol reference for below expression in informatica cloud
decode(true,STAGE_NAME_CODE='S1',:LKP.Lkp_SFDC_description(CODE),0)
in the unconnected lookup i have three fields code,code_type and description, I want to return description for stage_name_code from source file from the unconnected lookup field Code
but he onlytime the expression is valid is when its written like this..
decode(true,STAGE_NAME_CODE='S1',:LKP.Lkp_SFDC_description(STAGE_NAME_CODE))
Rather than using DECODE, you can use IIF function.
IIF(STAGE_NAME_CODE='S1',:LKP.Lkp_SFDC_description(STAGE_NAME_CODE))
This provides you an exact result.
To have fun on ETL, play with https://etlinfromatica.wordpress.com/

using eval() on string to access object attributes in R

I am trying to refer to a column of a data attribute of a spatial object using a string value of its name in R. I have no problem referring to the object only using eval(), but I could not refer to the attributes within the object using the same process.
So:
summary(eval(as.symbol(paste0("layerName", "_p", "5"))))
refers to the object layerName_p5 with no problems. However
summary(eval(as.symbol(paste0("layerName", "_p", "5", "#data$colName"))))
does not work, throwing the following error:
Error in summary(eval(as.symbol(paste0("layerName", "_p", "5",
"#data$colName")))) : error in evaluating the argument 'object' in
selecting a method for function 'summary': Error in eval(expr, envir,
enclos) : object 'layerName_p5#data$colName' not found
I’ll note here that #data is used to point to the data attribute within the spatial object layerName_p5, and $colName is a column within that data attribute. I know this exists, because calling
summary(eval(as.symbol(paste0("opNeon", "_p", "5")))#data$patRoute)
does work. But I would ideally like to be able to refer to the second part of the call using strings as well.
So ultimately my question is why I cannot refer to attributes within an object using a string of its name with eval() (or get() either)?
Things I’ve tried include a nested eval() statement (which I may or may not have gone about using correctly…) and attempting to access attributes using square brackets. Both attempts with relevant error messages below:
eval(eval(as.symbol(paste0("layerName", "_p", "5"))),"#data$colName")
Error in eval(eval(as.symbol(paste0("layerName", "_p", "5"))),
"#data$colname") : invalid 'envir' argument of type 'character'
eval(as.symbol(paste0("layerName", "_p", "5")))[eval(as.symbol("#data$colName"))]
Error in eval(expr, envir, enclos) : object '#data$colName' not found
I was wondering if anyone has come across this issue, and if yes if there are any solutions or if I'm just doing something wrong maybe? Any help would be very much appreciated!
Using the names in your working example, either
eval(call("$",
eval(call("#",
as.symbol(paste0("opNeon", "_p", "5")),
as.symbol("data"))),
as.symbol("patRoute")))
or
eval(call("#",
as.symbol(paste0("opNeon", "_p", "5")),
as.symbol("data")))[["patRoute"]]
would work.
Partial matching
If you want to match partial names for the data.frame column, the first option works as such. For the second option, you would need to add exact = FALSE as an option to [[. For example,
eval(call("#",
as.symbol(paste0("opNeon", "_p", "5")),
as.symbol("data")))[["patR", exact=FALSE]]
would return the same result using "patR" as a short form of "patRoute", assuming there is no other column name in opNeon_p5#datastarting with the string "patR".
I guess there is little to no need for partial matching in your use case (or non-interactive use in general). Type ?Extract in the R prompt for more information on partial matching.
Why the initial attempts failed
Now let's switch to shorter identifiers a, b and c for the remaining examples. The reason why eval(as.symbol("a#b")), eval(as.symbol("a$c")) or eval(as.symbol("a#b$c")) will not work is that symbols a.k.a. names refer to variables, but `#` and `$` as operators are not part of the variable name.
The small print
Another option that would work is eval(parse(text="a#b$c")), where text can be constructed by whatever means. This is safe as long as you are sure about the contents of text, but evaluating arbitrary expressions is not advisable.

Resources