-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault with query null value #1991
Comments
@ikingnet can you share the CV definition that this is being run against? We can't tell from the stack trace what the target column might be. |
CREATE SCHEMA bi_monitor;
CREATE FOREIGN TABLE bi_monitor.rt_stream_nginx_access (log jsonb) SERVER pipelinedb;
CREATE VIEW bi_monitor.rt_view_request_domain_stat WITH (action=materialize) AS
SELECT to_timestamp(log#>>'{timestamp}', 'YYYY-MM-DD HH24:MI:00') as stat_time,
log#>>'{c-host}' as request_domain,
COUNT(1) as pv,
SUM(cast(log#>>'{c-bytes}' as numeric)) as recive_bytes,
SUM(cast(log#>>'{s-bytes}' as numeric)) as send_bytes,
COUNT(DISTINCT (log#>>'{c-ip}',log#>>'{c-port}')) as client_conns,
round(avg(cast(log#>>'{c-cost-time}' as numeric)),4) as avg_time,
max(cast(log#>>'{c-cost-time}' as numeric)) as max_time,
percentile_cont(array[0.5, 0.95, 0.99]) WITHIN GROUP (ORDER BY cast(log#>>'{c-cost-time}' as numeric)) as per_99th
FROM bi_monitor.rt_stream_nginx_access
GROUP BY stat_time,request_domain;
CREATE INDEX ON bi_monitor.rt_view_request_domain_stat (stat_time);
CREATE INDEX ON bi_monitor.rt_view_request_domain_stat (request_domain,stat_time); |
@ikingnet do you have any example |
@ikingnet Currently attempting to repro with this: INSERT INTO rt_stream_nginx_access (log) SELECT
('{
"c-host": "c-host-' || (random() * 1000000)::int::text || '",
"c-port": ' || (random() * 10000)::int::text || ',
"c-bytes": ' || (random() * 100)::int::text || ',
"s-bytes": ' || (random() * 100)::int::text || ',
"c-ip": "127.0.0.1",
"c-cost-time": ' || (random() * 10000)::int::text || '
}')::jsonb
FROM generate_series(1, 1000000) x; Nothing yet, but can you share the plan that was used when the crash happened? e.g., EXPLAIN SELECT * FROM "rt_view_request_domain_stat" where stat_time is null limit 10 |
@ikingnet from the stack trace it looks like your installation was built from source--is that correct? If so, were there any modifications to the code (anything at all) and can you share the steps you used to build this binary? |
|
after execute this sql,the query |
@ikingnet do you have an |
@ikingnet I just wanted to follow up here to see if you're able to provide the |
CREATE VIEW bi_monitor.rt_view_request_url_stat_test WITH (action=materialize) AS
SELECT to_timestamp(log#>>'{timestamp}', 'YYYY-MM-DD HH24:MI:00') as stat_time,
log#>>'{c-host}' as request_domain,
log#>>'{c-uri-stem}' as request_uri,
COUNT(*) as pv,
SUM(cast(log#>>'{c-bytes}' as numeric)) as recive_bytes,
SUM(cast(log#>>'{s-bytes}' as numeric)) as send_bytes,
COUNT(DISTINCT (log#>>'{c-ip}',log#>>'{c-port}')) as client_conns,
round(avg(cast(log#>>'{c-cost-time}' as numeric)),4) as avg_time,
max(cast(log#>>'{c-cost-time}' as numeric)) as max_time,
percentile_cont(array[0.5, 0.95, 0.99]) WITHIN GROUP (ORDER BY cast(log#>>'{c-cost-time}' as numeric)) as per_99th
FROM bi_monitor.rt_stream_nginx_access_test
WHERE log#>>'{c-method}' != 'OPTIONS'
GROUP BY stat_time,request_domain,request_uri;
CREATE INDEX ON bi_monitor.rt_view_request_url_stat_test (stat_time);
CREATE INDEX ON bi_monitor.rt_view_request_url_stat_test (request_domain,request_uri,stat_time);
--the field 's-bytes' is missing
INSERT INTO bi_monitor.rt_stream_nginx_access_test values('{"@timestamp":"2018-12-26T02:13:46.435Z","beat":{"hostname":"BX-P120-129","name":"BX-P120-129","version":"5.5.0"},"c-bytes":174,"c-cost-time":0.006000,"c-host":"test.com","c-httpprotocol":"HTTP/1.1","c-ip":"-","c-method":"POST","c-request-args":"-","c-uri-stem":"/v1/work/getWorkList","c-useragent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36","input_type":"log","offset":2228875739,"s-ip":"10.20.120.69:80","s-response_time":0.006000,"s-status":"302","source":"/home/logs/test.com.log","timestamp":"2018-12-26T10:13:45+08:00","true":"","type":"apigw","version":1}')
-- this query will be get segmentation fault
select * from bi_monitor.rt_view_request_url_stat_test limit 10
|
if I modify this |
QUERY SQL:
SELECT * FROM "rt_view_request_domain_stat" where stat_time is null limit 10
The text was updated successfully, but these errors were encountered: