diff --git a/other_stuff/adattarhaz1.sql b/other_stuff/adattarhaz1.sql new file mode 100644 index 0000000000000000000000000000000000000000..54bbd8cab2a53e35b1538feb7a01df3dbcdea573 --- /dev/null +++ b/other_stuff/adattarhaz1.sql @@ -0,0 +1,49 @@ +drop table if exists battery_usage cascade; +drop table if exists dim_user cascade; +drop table if exists dim_statistics cascade; +drop table if exists dim_time cascade; + +create table battery_usage +( + ID int8 NOT NULL, + battery INTEGER, + time_surid int8, + user_surid int8, + statistics_surid int8, + PRIMARY KEY (ID) +); + +create table dim_user ( + surid int8 not null, + id int8 not null, + email varchar(255), + password varchar(255), + token varchar(255), + android_version INTEGER, + birth_date TIMESTAMP, + device_type VARCHAR(255), + primary key (id) +); + +create table dim_statistics ( + surid int8 not null, + id int8 not null, + location_dist DOUBLE PRECISION, + brightness INTEGER, + wifi_on BOOLEAN, + mobil_data_on BOOLEAN, + bluetooth_on BOOLEAN, + nfc_on BOOLEAN, + sleep_time INTEGER, + battery_temp DOUBLE PRECISION, + mobile_data_usage INTEGER, + wifi_data_usage INTEGER, + process_count INTEGER +); + +CREATE TABLE dim_time ( + surid int8 not null, + actual_time timestamp not null, + is_night BOOLEAN not null, + is_weekend BOOLEAN not null +); \ No newline at end of file diff --git a/other_stuff/curl_post_data.sh b/other_stuff/curl_post_data.sh new file mode 100755 index 0000000000000000000000000000000000000000..e29685c5a8406272a36a93a8d10100c7f702eec8 --- /dev/null +++ b/other_stuff/curl_post_data.sh @@ -0,0 +1,20 @@ +curl -X POST --header 'Content-Type: application/json' \ + --header 'Accept: */*' \ + --header "Authorization: $1" \ + -d '{ + "battery": 97, + "bluetoothOn": true, + "brightness": 20, + "location": { + "latitude": 49.090638, + "longitude": -126.947656 + }, + "mobilDataOn": true, + "nfcOn": true, + "sleepTime": 15, + "wifiOn": true, + "isWifiOn": true, + "isBluetoothOn": true, + "isNfcOn": true, + "isMobilDataOn": true +}' 'http://localhost:8090/api/data' diff --git a/other_stuff/elsogyonorusikerunk.xml b/other_stuff/elsogyonorusikerunk.xml new file mode 100644 index 0000000000000000000000000000000000000000..eb933536ae26e6bdcc63b0227420863ee0b425a0 --- /dev/null +++ b/other_stuff/elsogyonorusikerunk.xml @@ -0,0 +1,2375 @@ +<?xml version="1.0" ?> +<template encoding-version="1.1"> + <description></description> + <groupId>9619caf8-0162-1000-f0e0-cb9ef28a0c4a</groupId> + <name>elsogyonorusikerunk</name> + <snippet> + <connections> + <id>86f26c25-d50e-3fad-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>bd6272ec-401f-36e3-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>success</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>b29098bd-ba44-3f72-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>90a94e39-88c4-3db9-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>27ed1746-34a3-3138-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>sql</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>aaede91c-9e6e-3604-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>93d83078-c511-3dc8-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>93bceea2-3dcf-319f-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>original</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>72d0b1f1-f284-3676-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>960d130a-d507-3b21-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>b29098bd-ba44-3f72-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>matched</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>2df35544-d1d2-348d-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>ac87e045-57ca-3f56-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>8f18c6ea-29e6-3616-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>success</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>80ef277e-e9dc-3396-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>ad2a9470-c079-3e4d-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>80ef277e-e9dc-3396-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>success</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>f82c4723-7e7d-324f-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>afad25fe-2b7f-32b9-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>aaede91c-9e6e-3604-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>output stream</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>93bceea2-3dcf-319f-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>b6fefb7a-2590-34cd-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>27ed1746-34a3-3138-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>sql</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>68a64aa0-710f-3cd5-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>cae94039-f9d0-3a7a-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>365e941a-4f71-3e20-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>success</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>8f18c6ea-29e6-3616-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>f24c7479-c650-37ae-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>72d0b1f1-f284-3676-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>original</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>ad993322-33b2-370d-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>0ad6402f-ff3f-392e-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>2df35544-d1d2-348d-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>split</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>365e941a-4f71-3e20-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>1397203e-7a67-311f-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>27ed1746-34a3-3138-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>sql</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>a9780df7-1868-3bb5-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>1c729bdb-86a7-37db-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <bends> + <x>712.7970764982465</x> + <y>68.62216186523438</y> + </bends> + <bends> + <x>695.621905599809</x> + <y>25.1116943359375</y> + </bends> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>f82c4723-7e7d-324f-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name>Failure</name> + <selectedRelationships>failure</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>f82c4723-7e7d-324f-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>234f3bab-0f0c-38db-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>345c3449-c1aa-35b4-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>failure</selectedRelationships> + <selectedRelationships>success</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>27ed1746-34a3-3138-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>2efbb0cf-0a47-36c0-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>ad993322-33b2-370d-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>success</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>80ef277e-e9dc-3396-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>4514cf71-d14a-361d-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>a9780df7-1868-3bb5-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>output stream</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>ad993322-33b2-370d-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <connections> + <id>6cb09b55-91b4-346f-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> + <backPressureObjectThreshold>10000</backPressureObjectThreshold> + <destination> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>68a64aa0-710f-3cd5-0000-000000000000</id> + <type>PROCESSOR</type> + </destination> + <flowFileExpiration>0 sec</flowFileExpiration> + <labelIndex>1</labelIndex> + <name></name> + <selectedRelationships>output stream</selectedRelationships> + <source> + <groupId>3c884dc8-719c-3981-0000-000000000000</groupId> + <id>72d0b1f1-f284-3676-0000-000000000000</id> + <type>PROCESSOR</type> + </source> + <zIndex>0</zIndex> + </connections> + <controllerServices> + <id>ef7d99a4-0537-320f-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <bundle> + <artifact>nifi-distributed-cache-services-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <comments></comments> + <descriptors> + <entry> + <key>Server Hostname</key> + <value> + <name>Server Hostname</name> + </value> + </entry> + <entry> + <key>Server Port</key> + <value> + <name>Server Port</name> + </value> + </entry> + <entry> + <key>SSL Context Service</key> + <value> + <identifiesControllerService>org.apache.nifi.ssl.SSLContextService</identifiesControllerService> + <name>SSL Context Service</name> + </value> + </entry> + <entry> + <key>Communications Timeout</key> + <value> + <name>Communications Timeout</name> + </value> + </entry> + </descriptors> + <name>MyDistributedMapCacheClientService</name> + <persistsState>false</persistsState> + <properties> + <entry> + <key>Server Hostname</key> + <value>localhost</value> + </entry> + <entry> + <key>Server Port</key> + </entry> + <entry> + <key>SSL Context Service</key> + </entry> + <entry> + <key>Communications Timeout</key> + </entry> + </properties> + <state>ENABLED</state> + <type>org.apache.nifi.distributed.cache.client.DistributedMapCacheClientService</type> + </controllerServices> + <controllerServices> + <id>10d74082-e716-388f-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <bundle> + <artifact>nifi-dbcp-service-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <comments></comments> + <descriptors> + <entry> + <key>Database Connection URL</key> + <value> + <name>Database Connection URL</name> + </value> + </entry> + <entry> + <key>Database Driver Class Name</key> + <value> + <name>Database Driver Class Name</name> + </value> + </entry> + <entry> + <key>database-driver-locations</key> + <value> + <name>database-driver-locations</name> + </value> + </entry> + <entry> + <key>Database User</key> + <value> + <name>Database User</name> + </value> + </entry> + <entry> + <key>Password</key> + <value> + <name>Password</name> + </value> + </entry> + <entry> + <key>Max Wait Time</key> + <value> + <name>Max Wait Time</name> + </value> + </entry> + <entry> + <key>Max Total Connections</key> + <value> + <name>Max Total Connections</name> + </value> + </entry> + <entry> + <key>Validation-query</key> + <value> + <name>Validation-query</name> + </value> + </entry> + </descriptors> + <name>DBCPConnectionPool</name> + <persistsState>false</persistsState> + <properties> + <entry> + <key>Database Connection URL</key> + <value>jdbc:postgresql://localhost:5432/mobildata</value> + </entry> + <entry> + <key>Database Driver Class Name</key> + <value>org.postgresql.Driver</value> + </entry> + <entry> + <key>database-driver-locations</key> + <value>/home/wastack/Downloads/postgresql-42.2.2.jar</value> + </entry> + <entry> + <key>Database User</key> + <value>postgres</value> + </entry> + <entry> + <key>Password</key> + </entry> + <entry> + <key>Max Wait Time</key> + <value>500 millis</value> + </entry> + <entry> + <key>Max Total Connections</key> + <value>8</value> + </entry> + <entry> + <key>Validation-query</key> + </entry> + </properties> + <state>ENABLED</state> + <type>org.apache.nifi.dbcp.DBCPConnectionPool</type> + </controllerServices> + <controllerServices> + <id>25ffa067-51c9-35e4-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <bundle> + <artifact>nifi-dbcp-service-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <comments></comments> + <descriptors> + <entry> + <key>Database Connection URL</key> + <value> + <name>Database Connection URL</name> + </value> + </entry> + <entry> + <key>Database Driver Class Name</key> + <value> + <name>Database Driver Class Name</name> + </value> + </entry> + <entry> + <key>database-driver-locations</key> + <value> + <name>database-driver-locations</name> + </value> + </entry> + <entry> + <key>Database User</key> + <value> + <name>Database User</name> + </value> + </entry> + <entry> + <key>Password</key> + <value> + <name>Password</name> + </value> + </entry> + <entry> + <key>Max Wait Time</key> + <value> + <name>Max Wait Time</name> + </value> + </entry> + <entry> + <key>Max Total Connections</key> + <value> + <name>Max Total Connections</name> + </value> + </entry> + <entry> + <key>Validation-query</key> + <value> + <name>Validation-query</name> + </value> + </entry> + </descriptors> + <name>OlapDBConnection</name> + <persistsState>false</persistsState> + <properties> + <entry> + <key>Database Connection URL</key> + <value>jdbc:postgresql://localhost:5432/anal_data</value> + </entry> + <entry> + <key>Database Driver Class Name</key> + <value>org.postgresql.Driver</value> + </entry> + <entry> + <key>database-driver-locations</key> + <value>/home/wastack/Downloads/postgresql-42.2.2.jar</value> + </entry> + <entry> + <key>Database User</key> + <value>postgres</value> + </entry> + <entry> + <key>Password</key> + </entry> + <entry> + <key>Max Wait Time</key> + <value>500 millis</value> + </entry> + <entry> + <key>Max Total Connections</key> + <value>8</value> + </entry> + <entry> + <key>Validation-query</key> + </entry> + </properties> + <state>ENABLED</state> + <type>org.apache.nifi.dbcp.DBCPConnectionPool</type> + </controllerServices> + <processors> + <id>80ef277e-e9dc-3396-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>815.6959357131717</x> + <y>296.94882202148443</y> + </position> + <bundle> + <artifact>nifi-avro-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>JSON container options</key> + <value> + <name>JSON container options</name> + </value> + </entry> + <entry> + <key>Wrap Single Record</key> + <value> + <name>Wrap Single Record</name> + </value> + </entry> + <entry> + <key>Avro schema</key> + <value> + <name>Avro schema</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>JSON container options</key> + <value>array</value> + </entry> + <entry> + <key>Wrap Single Record</key> + <value>false</value> + </entry> + <entry> + <key>Avro schema</key> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>ConvertAvroToJSON</name> + <relationships> + <autoTerminate>true</autoTerminate> + <name>failure</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>success</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.avro.ConvertAvroToJSON</type> + </processors> + <processors> + <id>8f18c6ea-29e6-3616-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>763.1702296316132</x> + <y>557.7305496892545</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>release-signal-id</key> + <value> + <name>release-signal-id</name> + </value> + </entry> + <entry> + <key>target-signal-count</key> + <value> + <name>target-signal-count</name> + </value> + </entry> + <entry> + <key>signal-counter-name</key> + <value> + <name>signal-counter-name</name> + </value> + </entry> + <entry> + <key>wait-buffer-count</key> + <value> + <name>wait-buffer-count</name> + </value> + </entry> + <entry> + <key>releasable-flowfile-count</key> + <value> + <name>releasable-flowfile-count</name> + </value> + </entry> + <entry> + <key>expiration-duration</key> + <value> + <name>expiration-duration</name> + </value> + </entry> + <entry> + <key>distributed-cache-service</key> + <value> + <identifiesControllerService>org.apache.nifi.distributed.cache.client.AtomicDistributedMapCacheClient</identifiesControllerService> + <name>distributed-cache-service</name> + </value> + </entry> + <entry> + <key>attribute-copy-mode</key> + <value> + <name>attribute-copy-mode</name> + </value> + </entry> + <entry> + <key>wait-mode</key> + <value> + <name>wait-mode</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>release-signal-id</key> + <value>dim_ready</value> + </entry> + <entry> + <key>target-signal-count</key> + <value>3</value> + </entry> + <entry> + <key>signal-counter-name</key> + </entry> + <entry> + <key>wait-buffer-count</key> + <value>1</value> + </entry> + <entry> + <key>releasable-flowfile-count</key> + <value>1</value> + </entry> + <entry> + <key>expiration-duration</key> + <value>10 min</value> + </entry> + <entry> + <key>distributed-cache-service</key> + <value>ef7d99a4-0537-320f-0000-000000000000</value> + </entry> + <entry> + <key>attribute-copy-mode</key> + <value>keeporiginal</value> + </entry> + <entry> + <key>wait-mode</key> + <value>wait</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>Wait</name> + <relationships> + <autoTerminate>true</autoTerminate> + <name>expired</name> + </relationships> + <relationships> + <autoTerminate>true</autoTerminate> + <name>failure</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>success</name> + </relationships> + <relationships> + <autoTerminate>true</autoTerminate> + <name>wait</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.Wait</type> + </processors> + <processors> + <id>93bceea2-3dcf-319f-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>2341.1885247563832</x> + <y>288.4384056578708</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>Command Arguments</key> + <value> + <name>Command Arguments</name> + </value> + </entry> + <entry> + <key>Command Path</key> + <value> + <name>Command Path</name> + </value> + </entry> + <entry> + <key>Ignore STDIN</key> + <value> + <name>Ignore STDIN</name> + </value> + </entry> + <entry> + <key>Working Directory</key> + <value> + <name>Working Directory</name> + </value> + </entry> + <entry> + <key>Argument Delimiter</key> + <value> + <name>Argument Delimiter</name> + </value> + </entry> + <entry> + <key>Output Destination Attribute</key> + <value> + <name>Output Destination Attribute</name> + </value> + </entry> + <entry> + <key>Max Attribute Length</key> + <value> + <name>Max Attribute Length</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>Command Arguments</key> + <value>/home/wastack/PycharmProjects/transToAnal2/tansform.py;stats</value> + </entry> + <entry> + <key>Command Path</key> + <value>/usr/bin/python3.5</value> + </entry> + <entry> + <key>Ignore STDIN</key> + <value>false</value> + </entry> + <entry> + <key>Working Directory</key> + </entry> + <entry> + <key>Argument Delimiter</key> + <value>;</value> + </entry> + <entry> + <key>Output Destination Attribute</key> + </entry> + <entry> + <key>Max Attribute Length</key> + <value>256</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>ExecuteStreamCommand</name> + <relationships> + <autoTerminate>true</autoTerminate> + <name>original</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>output stream</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.ExecuteStreamCommand</type> + </processors> + <processors> + <id>a9780df7-1868-3bb5-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>1320.151346067871</x> + <y>595.9313451965476</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>JDBC Connection Pool</key> + <value> + <identifiesControllerService>org.apache.nifi.dbcp.DBCPService</identifiesControllerService> + <name>JDBC Connection Pool</name> + </value> + </entry> + <entry> + <key>Statement Type</key> + <value> + <name>Statement Type</name> + </value> + </entry> + <entry> + <key>Table Name</key> + <value> + <name>Table Name</name> + </value> + </entry> + <entry> + <key>Catalog Name</key> + <value> + <name>Catalog Name</name> + </value> + </entry> + <entry> + <key>Schema Name</key> + <value> + <name>Schema Name</name> + </value> + </entry> + <entry> + <key>Translate Field Names</key> + <value> + <name>Translate Field Names</name> + </value> + </entry> + <entry> + <key>Unmatched Field Behavior</key> + <value> + <name>Unmatched Field Behavior</name> + </value> + </entry> + <entry> + <key>Unmatched Column Behavior</key> + <value> + <name>Unmatched Column Behavior</name> + </value> + </entry> + <entry> + <key>Update Keys</key> + <value> + <name>Update Keys</name> + </value> + </entry> + <entry> + <key>jts-quoted-identifiers</key> + <value> + <name>jts-quoted-identifiers</name> + </value> + </entry> + <entry> + <key>jts-quoted-table-identifiers</key> + <value> + <name>jts-quoted-table-identifiers</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>JDBC Connection Pool</key> + <value>25ffa067-51c9-35e4-0000-000000000000</value> + </entry> + <entry> + <key>Statement Type</key> + <value>INSERT</value> + </entry> + <entry> + <key>Table Name</key> + <value>dim_time</value> + </entry> + <entry> + <key>Catalog Name</key> + </entry> + <entry> + <key>Schema Name</key> + </entry> + <entry> + <key>Translate Field Names</key> + <value>true</value> + </entry> + <entry> + <key>Unmatched Field Behavior</key> + <value>Ignore Unmatched Fields</value> + </entry> + <entry> + <key>Unmatched Column Behavior</key> + <value>Fail on Unmatched Columns</value> + </entry> + <entry> + <key>Update Keys</key> + </entry> + <entry> + <key>jts-quoted-identifiers</key> + <value>false</value> + </entry> + <entry> + <key>jts-quoted-table-identifiers</key> + <value>false</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>ConvertJSONToSQL</name> + <relationships> + <autoTerminate>true</autoTerminate> + <name>failure</name> + </relationships> + <relationships> + <autoTerminate>true</autoTerminate> + <name>original</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>sql</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.ConvertJSONToSQL</type> + </processors> + <processors> + <id>aaede91c-9e6e-3604-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>2352.572122435058</x> + <y>604.7108862121726</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>JDBC Connection Pool</key> + <value> + <identifiesControllerService>org.apache.nifi.dbcp.DBCPService</identifiesControllerService> + <name>JDBC Connection Pool</name> + </value> + </entry> + <entry> + <key>Statement Type</key> + <value> + <name>Statement Type</name> + </value> + </entry> + <entry> + <key>Table Name</key> + <value> + <name>Table Name</name> + </value> + </entry> + <entry> + <key>Catalog Name</key> + <value> + <name>Catalog Name</name> + </value> + </entry> + <entry> + <key>Schema Name</key> + <value> + <name>Schema Name</name> + </value> + </entry> + <entry> + <key>Translate Field Names</key> + <value> + <name>Translate Field Names</name> + </value> + </entry> + <entry> + <key>Unmatched Field Behavior</key> + <value> + <name>Unmatched Field Behavior</name> + </value> + </entry> + <entry> + <key>Unmatched Column Behavior</key> + <value> + <name>Unmatched Column Behavior</name> + </value> + </entry> + <entry> + <key>Update Keys</key> + <value> + <name>Update Keys</name> + </value> + </entry> + <entry> + <key>jts-quoted-identifiers</key> + <value> + <name>jts-quoted-identifiers</name> + </value> + </entry> + <entry> + <key>jts-quoted-table-identifiers</key> + <value> + <name>jts-quoted-table-identifiers</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>JDBC Connection Pool</key> + <value>25ffa067-51c9-35e4-0000-000000000000</value> + </entry> + <entry> + <key>Statement Type</key> + <value>INSERT</value> + </entry> + <entry> + <key>Table Name</key> + <value>dim_statistics</value> + </entry> + <entry> + <key>Catalog Name</key> + </entry> + <entry> + <key>Schema Name</key> + </entry> + <entry> + <key>Translate Field Names</key> + <value>true</value> + </entry> + <entry> + <key>Unmatched Field Behavior</key> + <value>Ignore Unmatched Fields</value> + </entry> + <entry> + <key>Unmatched Column Behavior</key> + <value>Fail on Unmatched Columns</value> + </entry> + <entry> + <key>Update Keys</key> + </entry> + <entry> + <key>jts-quoted-identifiers</key> + <value>false</value> + </entry> + <entry> + <key>jts-quoted-table-identifiers</key> + <value>false</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>ConvertJSONToSQL</name> + <relationships> + <autoTerminate>true</autoTerminate> + <name>failure</name> + </relationships> + <relationships> + <autoTerminate>true</autoTerminate> + <name>original</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>sql</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.ConvertJSONToSQL</type> + </processors> + <processors> + <id>ad993322-33b2-370d-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>1323.95240923376</x> + <y>292.22191674190816</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>Command Arguments</key> + <value> + <name>Command Arguments</name> + </value> + </entry> + <entry> + <key>Command Path</key> + <value> + <name>Command Path</name> + </value> + </entry> + <entry> + <key>Ignore STDIN</key> + <value> + <name>Ignore STDIN</name> + </value> + </entry> + <entry> + <key>Working Directory</key> + <value> + <name>Working Directory</name> + </value> + </entry> + <entry> + <key>Argument Delimiter</key> + <value> + <name>Argument Delimiter</name> + </value> + </entry> + <entry> + <key>Output Destination Attribute</key> + <value> + <name>Output Destination Attribute</name> + </value> + </entry> + <entry> + <key>Max Attribute Length</key> + <value> + <name>Max Attribute Length</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>Command Arguments</key> + <value>/home/wastack/PycharmProjects/transToAnal2/tansform.py;time</value> + </entry> + <entry> + <key>Command Path</key> + <value>/usr/bin/python3.5</value> + </entry> + <entry> + <key>Ignore STDIN</key> + <value>false</value> + </entry> + <entry> + <key>Working Directory</key> + </entry> + <entry> + <key>Argument Delimiter</key> + <value>;</value> + </entry> + <entry> + <key>Output Destination Attribute</key> + </entry> + <entry> + <key>Max Attribute Length</key> + <value>256</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>ExecuteStreamCommand</name> + <relationships> + <autoTerminate>false</autoTerminate> + <name>original</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>output stream</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.ExecuteStreamCommand</type> + </processors> + <processors> + <id>b29098bd-ba44-3f72-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>0.0</x> + <y>811.9696822172202</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>Regular Expression</key> + <value> + <name>Regular Expression</name> + </value> + </entry> + <entry> + <key>Replacement Value</key> + <value> + <name>Replacement Value</name> + </value> + </entry> + <entry> + <key>Character Set</key> + <value> + <name>Character Set</name> + </value> + </entry> + <entry> + <key>Maximum Buffer Size</key> + <value> + <name>Maximum Buffer Size</name> + </value> + </entry> + <entry> + <key>Replacement Strategy</key> + <value> + <name>Replacement Strategy</name> + </value> + </entry> + <entry> + <key>Evaluation Mode</key> + <value> + <name>Evaluation Mode</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>Regular Expression</key> + <value>(?s)(^.*$)</value> + </entry> + <entry> + <key>Replacement Value</key> + <value>INSERT INTO battery_fact (battery, + time_id, + user_id, + statistics_id) + SELECT ${battery}, fuckme.sur_id, fuckmehard.sur_id, fuckmeveryhard.sur_id + FROM + (select DISTINCT tim.sur_id + FROM + dim_time as tim + WHERE tim.stat_id = ${stat_id}) as fuckme + , + (select DISTINCT use.sur_id + FROM + dim_user_data as use + WHERE use.user_id = ${user_id} LIMIT 1) as fuckmehard + , + (select DISTINCT stat.sur_id + FROM + dim_statistics as stat + WHERE stat.stat_id = ${stat_id}) as fuckmeveryhard;</value> + </entry> + <entry> + <key>Character Set</key> + <value>UTF-8</value> + </entry> + <entry> + <key>Maximum Buffer Size</key> + <value>1 MB</value> + </entry> + <entry> + <key>Replacement Strategy</key> + <value>Always Replace</value> + </entry> + <entry> + <key>Evaluation Mode</key> + <value>Entire text</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>ReplaceText</name> + <relationships> + <autoTerminate>true</autoTerminate> + <name>failure</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>success</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.ReplaceText</type> + </processors> + <processors> + <id>bd6272ec-401f-36e3-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>540.2739441740277</x> + <y>827.9523468017578</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>INFO</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>JDBC Connection Pool</key> + <value> + <identifiesControllerService>org.apache.nifi.dbcp.DBCPService</identifiesControllerService> + <name>JDBC Connection Pool</name> + </value> + </entry> + <entry> + <key>Support Fragmented Transactions</key> + <value> + <name>Support Fragmented Transactions</name> + </value> + </entry> + <entry> + <key>Transaction Timeout</key> + <value> + <name>Transaction Timeout</name> + </value> + </entry> + <entry> + <key>Batch Size</key> + <value> + <name>Batch Size</name> + </value> + </entry> + <entry> + <key>Obtain Generated Keys</key> + <value> + <name>Obtain Generated Keys</name> + </value> + </entry> + <entry> + <key>rollback-on-failure</key> + <value> + <name>rollback-on-failure</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>JDBC Connection Pool</key> + <value>25ffa067-51c9-35e4-0000-000000000000</value> + </entry> + <entry> + <key>Support Fragmented Transactions</key> + <value>true</value> + </entry> + <entry> + <key>Transaction Timeout</key> + </entry> + <entry> + <key>Batch Size</key> + <value>100</value> + </entry> + <entry> + <key>Obtain Generated Keys</key> + <value>false</value> + </entry> + <entry> + <key>rollback-on-failure</key> + <value>false</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>PutSQL</name> + <relationships> + <autoTerminate>true</autoTerminate> + <name>failure</name> + </relationships> + <relationships> + <autoTerminate>true</autoTerminate> + <name>retry</name> + </relationships> + <relationships> + <autoTerminate>true</autoTerminate> + <name>success</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.PutSQL</type> + </processors> + <processors> + <id>f82c4723-7e7d-324f-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>827.3923523771527</x> + <y>0.0</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>Database Connection Pooling Service</key> + <value> + <identifiesControllerService>org.apache.nifi.dbcp.DBCPService</identifiesControllerService> + <name>Database Connection Pooling Service</name> + </value> + </entry> + <entry> + <key>SQL select query</key> + <value> + <name>SQL select query</name> + </value> + </entry> + <entry> + <key>Max Wait Time</key> + <value> + <name>Max Wait Time</name> + </value> + </entry> + <entry> + <key>dbf-normalize</key> + <value> + <name>dbf-normalize</name> + </value> + </entry> + <entry> + <key>dbf-user-logical-types</key> + <value> + <name>dbf-user-logical-types</name> + </value> + </entry> + <entry> + <key>dbf-default-precision</key> + <value> + <name>dbf-default-precision</name> + </value> + </entry> + <entry> + <key>dbf-default-scale</key> + <value> + <name>dbf-default-scale</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>Database Connection Pooling Service</key> + <value>10d74082-e716-388f-0000-000000000000</value> + </entry> + <entry> + <key>SQL select query</key> + <value>SELECT + data.battery, + data.actual_time, + + us.android_version, + us.birth_date, + us.device_type, + + data.id, + data.user_id, + data.location_lat, + data.location_long, + data.brightness, + data.wifi_on, + data.mobil_data_on, + data.bluetooth_on, + data.nfc_on, + data.sleep_time, + data.battery_temp, + data.mobile_data_usage, + data.wifi_data_usage, + COUNT(proc.mobile_data_id) as process_count +FROM + mobil_data as data + INNER JOIN mobil_user as us ON data.user_id = us.id + INNER JOIN process as proc ON proc.mobile_data_id = data.id +WHERE + data.is_charging = TRUE +GROUP BY data.id, us.android_version,us.birth_date, + us.device_type;</value> + </entry> + <entry> + <key>Max Wait Time</key> + <value>0 seconds</value> + </entry> + <entry> + <key>dbf-normalize</key> + <value>false</value> + </entry> + <entry> + <key>dbf-user-logical-types</key> + <value>false</value> + </entry> + <entry> + <key>dbf-default-precision</key> + <value>10</value> + </entry> + <entry> + <key>dbf-default-scale</key> + <value>0</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>2 min</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>ExecuteSQL</name> + <relationships> + <autoTerminate>false</autoTerminate> + <name>failure</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>success</name> + </relationships> + <state>STOPPED</state> + <style> + <entry> + <key>background-color</key> + <value>#ffffff</value> + </entry> + </style> + <type>org.apache.nifi.processors.standard.ExecuteSQL</type> + </processors> + <processors> + <id>27ed1746-34a3-3138-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>1799.6349060880902</x> + <y>800.7147369384766</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>JDBC Connection Pool</key> + <value> + <identifiesControllerService>org.apache.nifi.dbcp.DBCPService</identifiesControllerService> + <name>JDBC Connection Pool</name> + </value> + </entry> + <entry> + <key>Support Fragmented Transactions</key> + <value> + <name>Support Fragmented Transactions</name> + </value> + </entry> + <entry> + <key>Transaction Timeout</key> + <value> + <name>Transaction Timeout</name> + </value> + </entry> + <entry> + <key>Batch Size</key> + <value> + <name>Batch Size</name> + </value> + </entry> + <entry> + <key>Obtain Generated Keys</key> + <value> + <name>Obtain Generated Keys</name> + </value> + </entry> + <entry> + <key>rollback-on-failure</key> + <value> + <name>rollback-on-failure</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>JDBC Connection Pool</key> + <value>25ffa067-51c9-35e4-0000-000000000000</value> + </entry> + <entry> + <key>Support Fragmented Transactions</key> + <value>true</value> + </entry> + <entry> + <key>Transaction Timeout</key> + </entry> + <entry> + <key>Batch Size</key> + <value>100</value> + </entry> + <entry> + <key>Obtain Generated Keys</key> + <value>false</value> + </entry> + <entry> + <key>rollback-on-failure</key> + <value>false</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>PutSQL</name> + <relationships> + <autoTerminate>false</autoTerminate> + <name>failure</name> + </relationships> + <relationships> + <autoTerminate>true</autoTerminate> + <name>retry</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>success</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.PutSQL</type> + </processors> + <processors> + <id>2df35544-d1d2-348d-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>70.29329834407531</x> + <y>549.4530405785977</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>Destination</key> + <value> + <name>Destination</name> + </value> + </entry> + <entry> + <key>Return Type</key> + <value> + <name>Return Type</name> + </value> + </entry> + <entry> + <key>Path Not Found Behavior</key> + <value> + <name>Path Not Found Behavior</name> + </value> + </entry> + <entry> + <key>Null Value Representation</key> + <value> + <name>Null Value Representation</name> + </value> + </entry> + <entry> + <key>battery</key> + <value> + <name>battery</name> + </value> + </entry> + <entry> + <key>stat_id</key> + <value> + <name>stat_id</name> + </value> + </entry> + <entry> + <key>user_id</key> + <value> + <name>user_id</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>Destination</key> + <value>flowfile-attribute</value> + </entry> + <entry> + <key>Return Type</key> + <value>auto-detect</value> + </entry> + <entry> + <key>Path Not Found Behavior</key> + <value>warn</value> + </entry> + <entry> + <key>Null Value Representation</key> + <value>the string 'null'</value> + </entry> + <entry> + <key>battery</key> + <value>$.battery</value> + </entry> + <entry> + <key>stat_id</key> + <value>$.id</value> + </entry> + <entry> + <key>user_id</key> + <value>$.user_id</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>EvaluateJsonPath</name> + <relationships> + <autoTerminate>true</autoTerminate> + <name>failure</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>matched</name> + </relationships> + <relationships> + <autoTerminate>true</autoTerminate> + <name>unmatched</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.EvaluateJsonPath</type> + </processors> + <processors> + <id>345c3449-c1aa-35b4-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>1831.5888767437784</x> + <y>1070.0757313996342</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>release-signal-id</key> + <value> + <name>release-signal-id</name> + </value> + </entry> + <entry> + <key>signal-counter-name</key> + <value> + <name>signal-counter-name</name> + </value> + </entry> + <entry> + <key>signal-counter-delta</key> + <value> + <name>signal-counter-delta</name> + </value> + </entry> + <entry> + <key>signal-buffer-count</key> + <value> + <name>signal-buffer-count</name> + </value> + </entry> + <entry> + <key>distributed-cache-service</key> + <value> + <identifiesControllerService>org.apache.nifi.distributed.cache.client.AtomicDistributedMapCacheClient</identifiesControllerService> + <name>distributed-cache-service</name> + </value> + </entry> + <entry> + <key>attribute-cache-regex</key> + <value> + <name>attribute-cache-regex</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>release-signal-id</key> + <value>dim_ready</value> + </entry> + <entry> + <key>signal-counter-name</key> + <value>default</value> + </entry> + <entry> + <key>signal-counter-delta</key> + <value>1</value> + </entry> + <entry> + <key>signal-buffer-count</key> + <value>1</value> + </entry> + <entry> + <key>distributed-cache-service</key> + <value>ef7d99a4-0537-320f-0000-000000000000</value> + </entry> + <entry> + <key>attribute-cache-regex</key> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>Notify</name> + <relationships> + <autoTerminate>true</autoTerminate> + <name>failure</name> + </relationships> + <relationships> + <autoTerminate>true</autoTerminate> + <name>success</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.Notify</type> + </processors> + <processors> + <id>365e941a-4f71-3e20-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>404.9988664606633</x> + <y>321.943500550164</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>JsonPath Expression</key> + <value> + <name>JsonPath Expression</name> + </value> + </entry> + <entry> + <key>Null Value Representation</key> + <value> + <name>Null Value Representation</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>JsonPath Expression</key> + <value>$.*</value> + </entry> + <entry> + <key>Null Value Representation</key> + <value>empty string</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>SplitJson</name> + <relationships> + <autoTerminate>true</autoTerminate> + <name>failure</name> + </relationships> + <relationships> + <autoTerminate>true</autoTerminate> + <name>original</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>split</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.SplitJson</type> + </processors> + <processors> + <id>68a64aa0-710f-3cd5-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>1838.6517122788084</x> + <y>578.5658666809226</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>JDBC Connection Pool</key> + <value> + <identifiesControllerService>org.apache.nifi.dbcp.DBCPService</identifiesControllerService> + <name>JDBC Connection Pool</name> + </value> + </entry> + <entry> + <key>Statement Type</key> + <value> + <name>Statement Type</name> + </value> + </entry> + <entry> + <key>Table Name</key> + <value> + <name>Table Name</name> + </value> + </entry> + <entry> + <key>Catalog Name</key> + <value> + <name>Catalog Name</name> + </value> + </entry> + <entry> + <key>Schema Name</key> + <value> + <name>Schema Name</name> + </value> + </entry> + <entry> + <key>Translate Field Names</key> + <value> + <name>Translate Field Names</name> + </value> + </entry> + <entry> + <key>Unmatched Field Behavior</key> + <value> + <name>Unmatched Field Behavior</name> + </value> + </entry> + <entry> + <key>Unmatched Column Behavior</key> + <value> + <name>Unmatched Column Behavior</name> + </value> + </entry> + <entry> + <key>Update Keys</key> + <value> + <name>Update Keys</name> + </value> + </entry> + <entry> + <key>jts-quoted-identifiers</key> + <value> + <name>jts-quoted-identifiers</name> + </value> + </entry> + <entry> + <key>jts-quoted-table-identifiers</key> + <value> + <name>jts-quoted-table-identifiers</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>JDBC Connection Pool</key> + <value>25ffa067-51c9-35e4-0000-000000000000</value> + </entry> + <entry> + <key>Statement Type</key> + <value>INSERT</value> + </entry> + <entry> + <key>Table Name</key> + <value>dim_user_data</value> + </entry> + <entry> + <key>Catalog Name</key> + </entry> + <entry> + <key>Schema Name</key> + </entry> + <entry> + <key>Translate Field Names</key> + <value>true</value> + </entry> + <entry> + <key>Unmatched Field Behavior</key> + <value>Ignore Unmatched Fields</value> + </entry> + <entry> + <key>Unmatched Column Behavior</key> + <value>Fail on Unmatched Columns</value> + </entry> + <entry> + <key>Update Keys</key> + </entry> + <entry> + <key>jts-quoted-identifiers</key> + <value>false</value> + </entry> + <entry> + <key>jts-quoted-table-identifiers</key> + <value>false</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>ConvertJSONToSQL</name> + <relationships> + <autoTerminate>true</autoTerminate> + <name>failure</name> + </relationships> + <relationships> + <autoTerminate>true</autoTerminate> + <name>original</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>sql</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.ConvertJSONToSQL</type> + </processors> + <processors> + <id>72d0b1f1-f284-3676-0000-000000000000</id> + <parentGroupId>3c884dc8-719c-3981-0000-000000000000</parentGroupId> + <position> + <x>1856.8483113077223</x> + <y>283.85830486267</y> + </position> + <bundle> + <artifact>nifi-standard-nar</artifact> + <group>org.apache.nifi</group> + <version>1.4.0</version> + </bundle> + <config> + <bulletinLevel>WARN</bulletinLevel> + <comments></comments> + <concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount> + <descriptors> + <entry> + <key>Command Arguments</key> + <value> + <name>Command Arguments</name> + </value> + </entry> + <entry> + <key>Command Path</key> + <value> + <name>Command Path</name> + </value> + </entry> + <entry> + <key>Ignore STDIN</key> + <value> + <name>Ignore STDIN</name> + </value> + </entry> + <entry> + <key>Working Directory</key> + <value> + <name>Working Directory</name> + </value> + </entry> + <entry> + <key>Argument Delimiter</key> + <value> + <name>Argument Delimiter</name> + </value> + </entry> + <entry> + <key>Output Destination Attribute</key> + <value> + <name>Output Destination Attribute</name> + </value> + </entry> + <entry> + <key>Max Attribute Length</key> + <value> + <name>Max Attribute Length</name> + </value> + </entry> + </descriptors> + <executionNode>ALL</executionNode> + <lossTolerant>false</lossTolerant> + <penaltyDuration>30 sec</penaltyDuration> + <properties> + <entry> + <key>Command Arguments</key> + <value>/home/wastack/PycharmProjects/transToAnal2/tansform.py;user</value> + </entry> + <entry> + <key>Command Path</key> + <value>/usr/bin/python3.5</value> + </entry> + <entry> + <key>Ignore STDIN</key> + <value>false</value> + </entry> + <entry> + <key>Working Directory</key> + </entry> + <entry> + <key>Argument Delimiter</key> + <value>;</value> + </entry> + <entry> + <key>Output Destination Attribute</key> + </entry> + <entry> + <key>Max Attribute Length</key> + <value>256</value> + </entry> + </properties> + <runDurationMillis>0</runDurationMillis> + <schedulingPeriod>0 sec</schedulingPeriod> + <schedulingStrategy>TIMER_DRIVEN</schedulingStrategy> + <yieldDuration>1 sec</yieldDuration> + </config> + <name>ExecuteStreamCommand</name> + <relationships> + <autoTerminate>false</autoTerminate> + <name>original</name> + </relationships> + <relationships> + <autoTerminate>false</autoTerminate> + <name>output stream</name> + </relationships> + <state>STOPPED</state> + <style></style> + <type>org.apache.nifi.processors.standard.ExecuteStreamCommand</type> + </processors> + </snippet> + <timestamp>05/24/2018 01:20:53 CEST</timestamp> +</template> \ No newline at end of file diff --git a/other_stuff/ganyolas.md b/other_stuff/ganyolas.md new file mode 100644 index 0000000000000000000000000000000000000000..077e8da0c77e26fc0e989b2b9e0f7246773854ee --- /dev/null +++ b/other_stuff/ganyolas.md @@ -0,0 +1 @@ +- dim_user_data: distinct diff --git a/other_stuff/kiszopo.sql b/other_stuff/kiszopo.sql new file mode 100644 index 0000000000000000000000000000000000000000..522b56c0b75e9f1c934d94ff73be4c5e4a62217a --- /dev/null +++ b/other_stuff/kiszopo.sql @@ -0,0 +1,30 @@ +SELECT + data.battery, + data.actual_time, + + us.android_version, + us.birth_date, + us.device_type, + + data.id, + data.user_id, + data.location_lat, + data.location_long, + data.brightness, + data.wifi_on, + data.mobil_data_on, + data.bluetooth_on, + data.nfc_on, + data.sleep_time, + data.battery_temp, + data.mobile_data_usage, + data.wifi_data_usage, + COUNT(proc.mobile_data_id) as process_count +FROM + mobil_data as data + INNER JOIN mobil_user as us ON data.user_id = us.id + INNER JOIN process as proc ON proc.mobile_data_id = data.id +WHERE + data.is_charging = TRUE +GROUP BY data.id, us.android_version,us.birth_date, + us.device_type; \ No newline at end of file diff --git a/other_stuff/kiszopo_test.sql b/other_stuff/kiszopo_test.sql new file mode 100644 index 0000000000000000000000000000000000000000..bc0766cd1a266fddcdf436558a19b9e04eaf08f0 --- /dev/null +++ b/other_stuff/kiszopo_test.sql @@ -0,0 +1,19 @@ +CREATE TABLE kiszopo_test ( + battery INTEGER, + actual_time TIMESTAMP not null, + android_version INTEGER, + birth_date TIMESTAMP, + device_type VARCHAR(255), + location_lat DOUBLE PRECISION, + location_long DOUBLE PRECISION, + brightness INTEGER, + wifi_on BOOLEAN, + mobil_data_on BOOLEAN, + bluetooth_on BOOLEAN, + nfc_on BOOLEAN, + sleep_time INTEGER, + battery_temp DOUBLE PRECISION, + mobile_data_usage INTEGER, + wifi_data_usage INTEGER, + process_count INTEGER +); \ No newline at end of file diff --git a/other_stuff/postgres_puska.txt b/other_stuff/postgres_puska.txt new file mode 100644 index 0000000000000000000000000000000000000000..98ee7bb8cf58d33196fda7b2575e9793a4f6c5e0 --- /dev/null +++ b/other_stuff/postgres_puska.txt @@ -0,0 +1,10 @@ + +# Connect to database +sudo su - postgres +\connect mobildata + +# Show relations +\d + +# Kilépés +\q diff --git a/other_stuff/postman.tar.gz b/other_stuff/postman.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..44562e11a635a2412c7e7472508809b0557e9aa4 Binary files /dev/null and b/other_stuff/postman.tar.gz differ diff --git a/other_stuff/puska.txt b/other_stuff/puska.txt new file mode 100644 index 0000000000000000000000000000000000000000..140ea9b2e02fb48d48457f19a13f6f0a9ff739c6 --- /dev/null +++ b/other_stuff/puska.txt @@ -0,0 +1,62 @@ +Postgres: + create database anal_data + \connect anal_data +SELECT * FROM pg_catalog.pg_tables; + + { + "battery": 97, + "bluetooth_on": true, + "brightness": 20, + "id": 3, + "location_lat": 49.090638, + "location_long": -126.947656, + "mobil_data_on": true, + "nfc_on": true, + "sleep_time": 15, + "user_id": 1, + "wifi_on": true + }, + +/home/wastack/tmp/nifi-1.4.0/logs +/var/log/postgresql + + +sudo bin/nifi.sh install dataflow + +sudo -u postgres psql + +\connect anal_data + +\l <- list databases + +\t <- list tables + +Or: +SELECT * FROM pg_catalog.pg_tables; + +Run sql file: +\i /home/wastack/intellij/onlab/MobilDataServer/adattarhaz1.sql +\i /home/wastack/intellij/onlab/MobilDataServer/star_scheme1.sql + +adatbázis nevek: +anal_data +mobildata + +sudo apt-get install build-dep python-psycopg2 +easy_install psycopg2 + +postgresql+psycopg2://postgres:postgres@localhost:5432/anal_data + + +select * from kiszopo_test; + +Superset +-------- + +virtualenv venv +. ./venv/bin/activate + +superset runserver -d + +username: wastack +password: postgres diff --git a/other_stuff/schema.md b/other_stuff/schema.md new file mode 100644 index 0000000000000000000000000000000000000000..5725c80f6aad772eb60a506f7a441cac80cd35af --- /dev/null +++ b/other_stuff/schema.md @@ -0,0 +1,53 @@ +Analitikus +---------- + +Ténytábla: +- battery +- ido_id +- statistics_id +- user_id + +### Első szint + +- Idő: + +Naptári dátum +Nap megnevezése +Hét hanyadik napja +Hónap megnevezése +Évszám +Ünnep +Karácsony +Húsvét +Napszakasz +Nap hanyadik órája + +- User: + +Android verzió +Születési dátum +Születési év +Eszköz típusa +Samsung jelző +Huawei jelző +Nexus jelző +Oneplus jelző + +- Statisztics: + +adat kód (eredeti ID) +Elmozdulás: 10 percre átlagolva, eltelt időre normalizálva +Fényerő +WifiOn +MobilDataOn +BlueToothOn +NFCon +sleep_time +battery_temp DOUBLE PRECISION, +mobile_data_usage: abban az időszakban +wifi_data_usage +actual_time TIMESTAMP not null, +Eltelt idő, az előző adatfelvétel óta. +is_charging BOOLEAN +Futó appok száma +Fut-e Facebook jelző diff --git a/other_stuff/star_scheme1.sql b/other_stuff/star_scheme1.sql new file mode 100644 index 0000000000000000000000000000000000000000..9b940c2060f00f16ad903d9ce74228d9912e84ec --- /dev/null +++ b/other_stuff/star_scheme1.sql @@ -0,0 +1,73 @@ +drop table if exists battery_fact cascade; +drop table if exists dim_time cascade; +drop table if exists dim_statistics cascade; +drop table if exists dim_user_data cascade; + +CREATE TABLE battery_fact ( + battery INTEGER NOT NULL, + time_id INT8, + user_id INT8, + statistics_id INT8, + PRIMARY KEY (statistics_id) +); + +CREATE TABLE dim_time ( + sur_id SERIAL NOT NULL PRIMARY KEY, + stat_id INT8 NOT NULL, + calendar_datetime TIMESTAMP NOT NULL, + day_of_week_name VARCHAR(20), + day_of_week INTEGER, + month_name VARCHAR(20), + month INTEGER, + jear INTEGER, + holiday BOOLEAN, + christmas BOOLEAN, + day_period INTEGER, + hour_of_day INTEGER +); + +alter table battery_fact + add CONSTRAINT time_id_foreign_key +FOREIGN KEY ("time_id") +REFERENCES dim_time; + +CREATE TABLE dim_user_data ( + sur_id SERIAL NOT NULL PRIMARY KEY, + user_id INT8 NOT NULL, + android_api_version INTEGER, + birth_year INTEGER, + birth_date DATE, + device_type VARCHAR(50), + is_samsung BOOLEAN, + is_nexus BOOLEAN, + is_huawei BOOLEAN, + is_oneplus BOOLEAN +); + +alter table battery_fact + add CONSTRAINT user_id_foreign_key +FOREIGN KEY ("user_id") +REFERENCES dim_user_data; + +CREATE TABLE dim_statistics ( + sur_id SERIAL NOT NULL PRIMARY KEY, + stat_id INT8 NOT NULL, + movement INTEGER, + brightness INTEGER, + wifi_on BOOLEAN, + mobil_data_on BOOLEAN, + bluetooth_on BOOLEAN, + nfc_on BOOLEAN, + sleep_time INTEGER, + battery_temp DOUBLE PRECISION, + mobile_data_usage INTEGER, + wifi_data_usage INTEGER, + is_charging BOOLEAN, + process_count INTEGER, + is_facebook_on BOOLEAN +); + +alter table battery_fact + add CONSTRAINT statistics_id_foreign_key +FOREIGN KEY ("statistics_id") +REFERENCES dim_statistics; \ No newline at end of file diff --git a/other_stuff/star_scheme_query.sql b/other_stuff/star_scheme_query.sql new file mode 100644 index 0000000000000000000000000000000000000000..618c1a903f24b88457bca6bee5669fa4513c052a --- /dev/null +++ b/other_stuff/star_scheme_query.sql @@ -0,0 +1,6 @@ +select * +FROM + battery_fact as fact +INNER JOIN dim_time as tim ON tim.sur_id = fact.time_id +INNER JOIN dim_statistics as stat ON stat.sur_id = fact.statistics_id +INNER JOIN dim_user_data as usi ON usi.sur_id = fact.user_id; \ No newline at end of file diff --git a/other_stuff/tenykerdes.sql b/other_stuff/tenykerdes.sql new file mode 100644 index 0000000000000000000000000000000000000000..a0a8f5f93d2b8ca9f47b96fddfe46064c27e243a --- /dev/null +++ b/other_stuff/tenykerdes.sql @@ -0,0 +1,41 @@ +/*INSERT INTO battery_fact (battery, + time_id, + user_id, + statistics_id) +SELECT *, 2 +FROM +(select DISTINCT tim.sur_id +FROM + dim_time as tim +WHERE tim.stat_id = 76) as fuckme +UNION ALL +(select DISTINCT use.sur_id + FROM + dim_user_data as use + WHERE use.user_id = 1 LIMIT 1) +UNION ALL +(select DISTINCT stat.sur_id + FROM + dim_statistics as stat + WHERE stat.stat_id = 76);*/ + +INSERT INTO battery_fact (battery, + time_id, + user_id, + statistics_id) + SELECT 23, fuckme.sur_id, fuckmehard.sur_id, fuckmeveryhard.sur_id + FROM + (select DISTINCT tim.sur_id + FROM + dim_time as tim + WHERE tim.stat_id = 76) as fuckme + , + (select DISTINCT use.sur_id + FROM + dim_user_data as use + WHERE use.user_id = 1 LIMIT 1) as fuckmehard + , + (select DISTINCT stat.sur_id + FROM + dim_statistics as stat + WHERE stat.stat_id = 76) as fuckmeveryhard; \ No newline at end of file diff --git a/other_stuff/tenytabla_nifi_save.sql b/other_stuff/tenytabla_nifi_save.sql new file mode 100644 index 0000000000000000000000000000000000000000..c476df6657c7adb510ebdbb5cc85089c1f298310 --- /dev/null +++ b/other_stuff/tenytabla_nifi_save.sql @@ -0,0 +1,20 @@ +INSERT INTO battery_fact (battery, + time_id, + user_id, + statistics_id) + SELECT ${battery}, fuckme.sur_id, fuckmehard.sur_id, fuckmeveryhard.sur_id + FROM + (select DISTINCT tim.sur_id + FROM + dim_time as tim + WHERE tim.stat_id = ${stat_id}) as fuckme + , + (select DISTINCT use.sur_id + FROM + dim_user_data as use + WHERE use.user_id = ${user_id} LIMIT 1) as fuckmehard + , + (select DISTINCT stat.sur_id + FROM + dim_statistics as stat + WHERE stat.stat_id = ${stat_id}) as fuckmeveryhard;