Instantly share code, notes, and snippets.

@bardware bardware/tweets.sql
Last active Jul 16, 2017

Embed
What would you like to do?
Import tweets.csv into MySQL DB
CREATE TABLE `tweets` (
`tweet_id` bigint(11) NOT NULL,
`in_reply_to_status_id` bigint(11) NOT NULL,
`in_reply_to_user_id` bigint(11) NOT NULL,
`timestamp` varchar(100) COLLATE utf8mb4_german2_ci NOT NULL,
`source` varchar(4000) COLLATE utf8mb4_german2_ci NOT NULL,
`text` varchar(4000) COLLATE utf8mb4_german2_ci DEFAULT NULL,
`retweeted_status_id` bigint(11) DEFAULT NULL,
`retweeted_status_user_id` bigint(11) DEFAULT NULL,
`retweeted_status_timestamp` bigint(11) DEFAULT NULL,
`expanded_urls` varchar(4000) COLLATE utf8mb4_german2_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_german2_ci
LOAD DATA LOCAL INFILE 'tweets.csv' INTO TABLE tweets FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '' LINES TERMINATED BY '\n';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment