(&mut self)
| 4797 | } |
| 4798 | |
| 4799 | fn parse_source_include_metadata(&mut self) -> Result<Vec<SourceIncludeMetadata>, ParserError> { |
| 4800 | if self.parse_keyword(INCLUDE) { |
| 4801 | self.parse_comma_separated(|parser| { |
| 4802 | let metadata = match parser |
| 4803 | .expect_one_of_keywords(&[KEY, TIMESTAMP, PARTITION, OFFSET, HEADERS, HEADER])? |
| 4804 | { |
| 4805 | KEY => SourceIncludeMetadata::Key { |
| 4806 | alias: parser.parse_alias()?, |
| 4807 | }, |
| 4808 | TIMESTAMP => SourceIncludeMetadata::Timestamp { |
| 4809 | alias: parser.parse_alias()?, |
| 4810 | }, |
| 4811 | PARTITION => SourceIncludeMetadata::Partition { |
| 4812 | alias: parser.parse_alias()?, |
| 4813 | }, |
| 4814 | OFFSET => SourceIncludeMetadata::Offset { |
| 4815 | alias: parser.parse_alias()?, |
| 4816 | }, |
| 4817 | HEADERS => SourceIncludeMetadata::Headers { |
| 4818 | alias: parser.parse_alias()?, |
| 4819 | }, |
| 4820 | HEADER => { |
| 4821 | let key: String = parser.parse_literal_string()?; |
| 4822 | parser.expect_keyword(AS)?; |
| 4823 | let alias = parser.parse_identifier()?; |
| 4824 | let use_bytes = parser.parse_keyword(BYTES); |
| 4825 | SourceIncludeMetadata::Header { |
| 4826 | alias, |
| 4827 | key, |
| 4828 | use_bytes, |
| 4829 | } |
| 4830 | } |
| 4831 | _ => unreachable!("only explicitly allowed items can be parsed"), |
| 4832 | }; |
| 4833 | Ok(metadata) |
| 4834 | }) |
| 4835 | } else { |
| 4836 | Ok(vec![]) |
| 4837 | } |
| 4838 | } |
| 4839 | |
| 4840 | fn parse_discard(&mut self) -> Result<Statement<Raw>, ParserError> { |
| 4841 | let target = match self.expect_one_of_keywords(&[ALL, PLANS, SEQUENCES, TEMP, TEMPORARY])? { |
no test coverage detected