-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lookup and sort by sum of page views
- Loading branch information
User
authored and
User
committed
Jan 30, 2021
0 parents
commit e92070b
Showing
9 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
력糔㼕☈⼽�氇궅鐔亩䮟�픘䣖架ꝯᐋ⼃ᨑ儍땇⤵腱⇕䞙䤹䆓燯㱆馗蕮䬳읗䰓⾯Α萩涓�㷿욕恍ג駇䱳齇⢂栟黵烼窛ꯧ≣앀뮒ꍄ㫰�槂耂銧烙ꎽ�騅ꥆ籙涫푍⭧ߦᎃ㢶㨇Ꮱ亶纻㹾ዘ鉒틣앵명䄡蘴撜쎫햎꺳 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"folders": {}, | ||
"connections": { | ||
"postgres-jdbc-176f7b8b950-5894084747c1b37d": { | ||
"provider": "postgresql", | ||
"driver": "postgres-jdbc", | ||
"name": "samyers", | ||
"save-password": true, | ||
"show-system-objects": true, | ||
"read-only": false, | ||
"configuration": { | ||
"host": "localhost", | ||
"port": "5432", | ||
"database": "samyers", | ||
"url": "jdbc:postgresql://localhost:5432/samyers", | ||
"home": "postgresql_client", | ||
"type": "dev", | ||
"properties": { | ||
"connectTimeout": "20", | ||
"loginTimeout": "20" | ||
}, | ||
"provider-properties": { | ||
"@dbeaver-show-non-default-db@": "false", | ||
"@dbeaver-show-template-db@": "false", | ||
"@dbeaver-show-unavailable-db@": "false", | ||
"postgresql.dd.plain.string": "false", | ||
"postgresql.dd.tag.string": "false" | ||
}, | ||
"auth-model": "native" | ||
} | ||
}, | ||
"apache_hive2-1773aaa0714-4ccd17a4d50e30c4": { | ||
"provider": "hive", | ||
"driver": "apache_hive2", | ||
"name": "localhost", | ||
"save-password": true, | ||
"show-system-objects": true, | ||
"read-only": false, | ||
"configuration": { | ||
"host": "localhost", | ||
"port": "10000", | ||
"url": "jdbc:hive2://localhost:10000", | ||
"type": "dev", | ||
"auth-model": "native", | ||
"handlers": {} | ||
} | ||
} | ||
}, | ||
"connection-types": { | ||
"dev": { | ||
"name": "Development", | ||
"color": "255,255,255", | ||
"description": "Regular development database", | ||
"auto-commit": true, | ||
"confirm-execute": false, | ||
"confirm-data-change": false | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"resources":{"Scripts/Script-1.sql":{"default-schema":"public","sql-editor-data-source-id":"postgres-jdbc-176f7b8b950-5894084747c1b37d","default-datasource":"postgres-jdbc-176f7b8b950-5894084747c1b37d","default-catalog":"samyers"},"Scripts/Script-2.sql":{"default-schema":"project0","sql-editor-data-source-id":"postgres-jdbc-176f7b8b950-5894084747c1b37d","default-datasource":"postgres-jdbc-176f7b8b950-5894084747c1b37d","default-catalog":"samyers"},"Scripts/Script-3.sql":{"default-schema":"project0","sql-editor-data-source-id":"postgres-jdbc-176f7b8b950-5894084747c1b37d","default-datasource":"postgres-jdbc-176f7b8b950-5894084747c1b37d","default-catalog":"samyers"},"Scripts/Script-4.sql":{"default-schema":"pageviews","sql-editor-data-source-id":"apache_hive2-1773aaa0714-4ccd17a4d50e30c4","default-datasource":"apache_hive2-1773aaa0714-4ccd17a4d50e30c4","default-catalog":"samyers"},"Scripts/Script.sql":{"default-schema":"public","sql-editor-data-source-id":"postgres-jdbc-176f7b8b950-5894084747c1b37d","default-datasource":"postgres-jdbc-176f7b8b950-5894084747c1b37d","default-catalog":"samyers"}}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>General</name> | ||
<comment>General DBeaver project</comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.jkiss.dbeaver.DBeaverNature</nature> | ||
</natures> | ||
</projectDescription> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- DML : data mainpulation language, used to insert, update, and delete individual records | ||
-- DQL | ||
|
||
create table dogs (id SERIAL, name TEXT); | ||
|
||
alter sequence dogs_id_seq restart with 100; | ||
|
||
insert into dogs values | ||
(default, 'fido'), | ||
(default, 'rex'), | ||
(default, 'fido'), | ||
(default, 'fido'); | ||
|
||
update dogs set name = 'blue' where id = 4; | ||
update dogs set name = 'red' where id = 3; | ||
|
||
delete from dogs | ||
|
||
select * from dogs; | ||
|
||
drop table dogs; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
select * from movies; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
select * from movies; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
CREATE DATABASE pageviews; | ||
|
||
USE pageviews; | ||
|
||
CREATE TABLE pageviews ( | ||
lang STRING, | ||
page STRING, | ||
count INT | ||
) ROW FORMAT DELIMITED | ||
FIELDS TERMINATED BY ' '; | ||
|
||
DESCRIBE pageviews; | ||
|
||
LOAD DATA LOCAL INPATH '/home/samyers/hadoop-2.7.7/pageviews/pageviews' INTO TABLE pageviews; | ||
|
||
SELECT * FROM pageviews; | ||
|
||
SELECT DISTINCT(page), SUM(count) OVER (PARTITION BY page ORDER BY page DESC) | ||
AS total_count FROM pageviews | ||
WHERE lang = 'en' AND page != 'Main_Page' AND page != 'Special:Search' AND page != '-'; | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
select * from cats; |