Repository: sqlfluff/sqlfluff
Issue category: Bug Report

Hive `ALTER VIEW` unparsable
### Search before asking

- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.


### What Happened

SQLfluff fails to parse `ALTER VIEW` queries, despite being supported by Hive - see [docs](https://cwiki.apache.org/confluence/display/hive/languagemanual+ddl#LanguageManualDDL-AlterViewProperties).

Failures happen for both `ALTER VIEW... AS SELECT...` and `ALTER VIEW ... SET TBLPROPERTIES...` queries.

### Expected Behaviour

This should be parsed without any failures.

### Observed Behaviour

```
==== parsing violations ====
L:   1 | P:   1 |  PRS | Line 1, Position 1: Found unparsable section: 'ALTER VIEW foo AS
                       | SELECT col1 FROM bar;'
```

### How to reproduce

```sh
echo 'ALTER VIEW foo AS SELECT col1 FROM bar;' | sqlfluff parse --dialect=hive -
```

### Dialect

Hive

### Version

sqlfluff, version 3.2.5
Python 3.10

### Configuration

```
[sqlfluff]
dialect = hive
```

### Are you willing to work on and submit a PR to address the issue?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/sqlfluff/sqlfluff/blob/main/CODE_OF_CONDUCT.md)



Functions to edit:
src/sqlfluff/dialects/dialect_hive.py:StatementSegment
Functions added: src/sqlfluff/dialects/dialect_hive.py:AlterViewStatementSegment

Patch:
diff --git a/src/sqlfluff/dialects/dialect_hive.py b/src/sqlfluff/dialects/dialect_hive.py
index 68ef2ecc295..c9a372cc356 100644
--- a/src/sqlfluff/dialects/dialect_hive.py
+++ b/src/sqlfluff/dialects/dialect_hive.py
@@ -706,6 +706,7 @@ class StatementSegment(ansi.StatementSegment):
             Ref("MsckRepairTableStatementSegment"),
             Ref("MsckTableStatementSegment"),
             Ref("SetStatementSegment"),
+            Ref("AlterViewStatementSegment"),
         ],
         remove=[
             Ref("TransactionStatementSegment"),
@@ -1086,3 +1087,25 @@ class SortByClauseSegment(ansi.OrderByClauseSegment):
         ),
         Dedent,
     )
+
+
+class AlterViewStatementSegment(BaseSegment):
+    """A `ALTER VIEW` statement to change the view schema or properties.
+
+    https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Create/Drop/AlterView
+    """
+
+    type = "alter_view_statement"
+
+    match_grammar = Sequence(
+        "ALTER",
+        "VIEW",
+        Ref("TableReferenceSegment"),
+        OneOf(
+            Sequence("SET", Ref("TablePropertiesGrammar")),
+            Sequence(
+                "AS",
+                OptionallyBracketed(Ref("SelectStatementSegment")),
+            ),
+        ),
+    )

Test patch: diff --git a/test/fixtures/dialects/hive/alter_view.sql b/test/fixtures/dialects/hive/alter_view.sql
new file mode 100644
index 00000000000..d2ecf4b9415
--- /dev/null
+++ b/test/fixtures/dialects/hive/alter_view.sql
@@ -0,0 +1,3 @@
+ALTER VIEW db.foo AS SELECT col1 FROM db.bar;
+
+ALTER VIEW foo SET TBLPROPERTIES ('bar' = '1', 'baz' = '2');
diff --git a/test/fixtures/dialects/hive/alter_view.yml b/test/fixtures/dialects/hive/alter_view.yml
new file mode 100644
index 00000000000..eb4f37273bf
--- /dev/null
+++ b/test/fixtures/dialects/hive/alter_view.yml
@@ -0,0 +1,53 @@
+# YML test files are auto-generated from SQL files and should not be edited by
+# hand. To help enforce this, the "hash" field in the file must match a hash
+# computed by SQLFluff when running the tests. Please run
+# `python test/generate_parse_fixture_yml.py`  to generate them after adding or
+# altering SQL files.
+_hash: 436d5a23d3827fc3338561a5192f73152eb735856639d5bc323f546db15d81fe
+file:
+- statement:
+    alter_view_statement:
+    - keyword: ALTER
+    - keyword: VIEW
+    - table_reference:
+      - naked_identifier: db
+      - dot: .
+      - naked_identifier: foo
+    - keyword: AS
+    - select_statement:
+        select_clause:
+          keyword: SELECT
+          select_clause_element:
+            column_reference:
+              naked_identifier: col1
+        from_clause:
+          keyword: FROM
+          from_expression:
+            from_expression_element:
+              table_expression:
+                table_reference:
+                - naked_identifier: db
+                - dot: .
+                - naked_identifier: bar
+- statement_terminator: ;
+- statement:
+    alter_view_statement:
+    - keyword: ALTER
+    - keyword: VIEW
+    - table_reference:
+        naked_identifier: foo
+    - keyword: SET
+    - keyword: TBLPROPERTIES
+    - bracketed:
+      - start_bracket: (
+      - quoted_literal: "'bar'"
+      - comparison_operator:
+          raw_comparison_operator: '='
+      - quoted_literal: "'1'"
+      - comma: ','
+      - quoted_literal: "'baz'"
+      - comparison_operator:
+          raw_comparison_operator: '='
+      - quoted_literal: "'2'"
+      - end_bracket: )
+- statement_terminator: ;