hrbrmstr / drill-url-tools Goto Github PK
View Code? Open in Web Editor NEWA set of Apache Drill UDFs for working with URLs
License: MIT License
A set of Apache Drill UDFs for working with URLs
License: MIT License
With big dataset (>1000000 rows) url_parse produce unexpected results.
Example:
SELECT * FROM ( SELECT R.Url, R.f.host as host FROM ( SELECT T.Url, url_parse(T.Url)) AS f FROM ... AS T) AS R) ) WHERE host LIKE '80to%' LIMIT 1;
+----------------------------------------------------------------------------------+-----------------+
| Url | host |
+----------------------------------------------------------------------------------+-----------------+
| http://patriot-auto.ru/addnews.html | 80togh-pro.rozb |
+----------------------------------------------------------------------------------+-----------------+
Although
SELECT t.p.host FROM (SELECT url_parse('http://patriot-auto.ru/addnews.html') AS p) AS t;
+-----------------+
| EXPR$0 |
+-----------------+
| patriot-auto.ru |
+-----------------+
Find in the source
buffer.reallocIfNeeded(...);
Instead of
buffer = buffer.reallocIfNeeded(...);
The size of the buffer is unchanged and some problems may appears (some of these problems are currently catched by the "try/catch" in the code but produce bad results.
Examples
`
apache drill> select url_parse('http://www.gooogle.com.uk') /* OK */;
+----------------------------------------------------------------------------------+
| EXPR$0 |
+----------------------------------------------------------------------------------+
| {"scheme":"http","username":"","host":"www.gooogle.com.uk","port":"80","path":"/"} |
+----------------------------------------------------------------------------------+
apache drill> select url_parse('http://www.go--oogle.com.uk') /* NOK */;
+--------+
| EXPR$0 |
+--------+
| {} |
+--------+
apache drill> select url_parse('http://www.g--ooogle.com.uk') /* OK */;
+----------------------------------------------------------------------------------+
| EXPR$0 |
+----------------------------------------------------------------------------------+
| {"scheme":"http","username":"","host":"www.g--ooogle.com.uk","port":"80","path":"/"} |
+----------------------------------------------------------------------------------+
apache drill> select url_parse('http://www.goo--ogle.com.uk') /* OK */;
+----------------------------------------------------------------------------------+
| EXPR$0 |
+----------------------------------------------------------------------------------+
| {"scheme":"http","username":"","host":"www.goo--ogle.com.uk","port":"80","path":"/"} |
+----------------------------------------------------------------------------------+
apache drill> select url_parse('http://www.gooogle.co--m.uk') /* NOK */ ;
+--------+
| EXPR$0 |
+--------+
| {} |
+--------+
apache drill> select url_parse('http://tv--portal.blogspot.de/2011/07/tvn-en-vivo-panama.html') /* NOK */;
+--------+
| EXPR$0 |
+--------+
| {} |
+--------+
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.