Athena - remove quotes and skip the first line in a GZIP compressed CSV file

0

Hi,

I've tried to run the following DDL statement in Athena:

querying GZIP compressed CSV files

For some reason, it won't remove the first line, neither the quotes character (") from the output.

I've found a relevant thread on AWS forums where other people that ran into this issue as well: https://forums.aws.amazon.com/thread.jspa?messageID=755357&threadID=244207&tstart=0

Would love to hear your thoughts about this.

DDL Statement:

CREATE EXTERNAL TABLE IF NOT EXISTS table_name_here (
  eventID STRING,
  userID STRING,
  sessionID STRING,
  eventDate STRING,
  eventTimestamp STRING,
  eventName STRING,
  eventLevel INT,
  gaUserStartDate STRING,
  gaUserGender STRING,
  gaUserAgeGroup STRING,
  gaUserCountry STRING,
  gaUserAcquisitionChannel STRING,
  msSinceLastEvent STRING,
  browserName STRING,
  browserVersion STRING,
  campaign STRING,
  clientVersion STRING,
  collectInsertedTimestamp STRING,
  convertedProductAmount STRING,
  externalUserID STRING,
  mainEventID STRING,
  network STRING,
  operatingSystem STRING,
  operatingSystemVersion STRING,
  parentEventID STRING,
  platform STRING,
  productAmount STRING,
  productCategory STRING,
  productID STRING,
  productName STRING,
  productType STRING,
  realCurrencyAmount INT,
  realCurrencyType STRING,
  revenueValidated INT,
  signupSource STRING,
  transactionID STRING,
  transactionName STRING,
  transactionSourceId INT,
  transactionSourceName STRING,
  transactionStatus STRING,
  transactionType STRING,
  transactionVector STRING,
  userLevel INT,
  userType STRING,
  virtualCurrencyAmount INT,
  virtualCurrencyName STRING,
  virtualCurrencyType STRING,
  visitSource  STRING
)

    ROW FORMAT DELIMITED
      FIELDS TERMINATED BY ','
      ESCAPED BY '\\'
      LINES TERMINATED BY '\n'
LOCATION 's3://path/to/bucket'
TBLPROPERTIES (
	"skip.header.line.count"="1",
	"quoteChar"='"'
);
AWS
질문됨 7년 전1859회 조회
1개 답변
0
수락된 답변

Neither skip.header.line.count nor quoteChar are supported in Athena at this time.

In particular, quoteChar is not valid for the LazySimpleSerde (ROW FORMAT DELIMITED). It is a property of OpenCSVSerde, which is not supported in Athena yet.

AWS
답변함 7년 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠