Skip to content

Can a formula with a division be used in a blocking rule? #1047

Answered by ADBond
adelinor asked this question in Q&A
Discussion options

You must be logged in to vote

I believe the issue here is that the column text_size is made of integers, and so duckdb is performing integer division - in 2 cases it rounds to 1, and in the third it rounds to 0, which is why you are getting only 2 comparisons for those blocking rules.

You can either convert your initial column to a floating-point type (e.g. df["text_size"] = df["text_size"].astype(float)) which is probably preferable if you aim to perform these kinds of calculations, or use an explicit cast in your blocking rules (e.g. changing l.text_size / r.text_size to CAST(l.text_size AS double)/r.text_size) - although in this case you will need to explicitly cast anywhere else you may want to do divisions such a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@adelinor
Comment options

Answer selected by adelinor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants