Created
August 22, 2020 17:57
-
-
Save benjaminlaird/03b1bbd323b6e7bb0455c0a7489a3529 to your computer and use it in GitHub Desktop.
Range join query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spark.sql(''' | |
SELECT ips.ip, ips.ip_int, asns.asn | |
FROM ips inner join asns | |
ON ips.ip_network = asns.network | |
WHERE ips.ip_int > asns.ip_min and ips.ip_int < asns.ip_max | |
''').count() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment