GitHub user HeartSaVioR opened a pull request: https://github.com/apache/storm/pull/1742
STORM-2170 Add built-in socket datasource to runtime * Add Socket datasource (input/output) in storm-sql-runtime module * only for test purpose, no guarantee * scheme: 'socket' Since Socket datasource is in storm-sql-runtime, it's registered to DataSourcesProvider by default. So below SQL statements doesn't need any external artifacts at all and can be executed to below command: ``` ./bin/storm sql apache_log_error_filtering_socket.sql apache_log_error_filtering_socket ``` ``` CREATE EXTERNAL TABLE APACHE_LOGS (ID INT PRIMARY KEY, REMOTE_IP VARCHAR, REQUEST_URL VARCHAR, REQUEST_METHOD VARCHAR, STATUS VARCHAR, REQUEST_HEADER_USER_AGENT VARCHAR, TIME_RECEIVED_UTC_ISOFORMAT VARCHAR, TIME_US DOUBLE) LOCATION 'socket://localhost:8889' CREATE EXTERNAL TABLE APACHE_ERROR_LOGS (ID INT PRIMARY KEY, REMOTE_IP VARCHAR, REQUEST_URL VARCHAR, REQUEST_METHOD VARCHAR, STATUS INT, REQUEST_HEADER_USER_AGENT VARCHAR, TIME_RECEIVED_UTC_ISOFORMAT VARCHAR, TIME_ELAPSED_MS INT) LOCATION 'socket://localhost:8890' INSERT INTO APACHE_ERROR_LOGS SELECT ID, REMOTE_IP, REQUEST_URL, REQUEST_METHOD, CAST(STATUS AS INT) AS STATUS_INT, REQUEST_HEADER_USER_AGENT, TIME_RECEIVED_UTC_ISOFORMAT, (TIME_US / 1000) AS TIME_ELAPSED_MS FROM APACHE_LOGS WHERE (CAST(STATUS AS INT) / 100) >= 4 ``` Manually tested via opening tcp servers via netcat. You can merge this pull request into a Git repository by running: $ git pull https://github.com/HeartSaVioR/storm STORM-2170 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/storm/pull/1742.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1742 ---- commit 885415eb64e1efc0f9a498a2380d3a67d680bc11 Author: Jungtaek Lim <kabh...@gmail.com> Date: 2016-10-21T12:57:43Z STORM-2170 Add built-in socket datasource to runtime * Add Socket datasource (input/output) in storm-sql-runtime module * only for test purpose, no guarantee * scheme: 'socket' ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---