Repository: pgjones/flake8-sql (language: python)

Issue:
Should ABS trigger Q442?
Hi there,

I'm wondering why `ABS` is in the abbreviated keywords list, as (to the best of my knowledge) it is not really an abbreviation but a proper function.  I'm using PostgreSQL but from what I've seen both SQL Server and MySQL do have that function (PostgreSQL also has an abbreviated form of that function, `@ <number>`, but that's even worse...).

Are there any plans to remove that from such list or should I stick with `# noqa: Q442`?

Thanks!


Discussion / hints:
I think you are correct, in that I can't find evidence a `absolute` function exists. Would you like to propose a PR?
EDIT: Nevermind, `CREATE` statements aren't parsed it seems.

---

I'm actually working on it.  However if `ABS` gets removed from the abbreviations then the whole `abbreviated_keywords.py` test case goes away.  I've added something to keep the functionality being tested and turns out that it might be bugged.

If I read things right, `CREATE TABLE tbl (clmn DEC)` doesn't trigger a warning even though `DEC` is an abbreviation and is present in the known abbreviations list.  I put this in the test case:

```python
query = "CREATE TABLE tbl (clmn DEC)"  # Q442
query = "CREATE TABLE tbl (clmn DECIMAL)"
```

and the test fails with

```
E       AssertionError: assert set() == {(1, 'Q442')}
E         Extra items in the right set:
E         (1, 'Q442')
```

which I assume it means Q442 was not triggered.  Is that so?

Fix patch:
diff --git a/flake8_sql/keywords.py b/flake8_sql/keywords.py
index dd64247..935c77d 100644
--- a/flake8_sql/keywords.py
+++ b/flake8_sql/keywords.py
@@ -1,5 +1,4 @@
 ABBREVIATED_KEYWORDS = {
-    'ABS',
     'CHAR',
     'CHAR_LENGTH',
     'DEC',


Test patch:
diff --git a/tests/test_cases/abbreviated_keywords.py b/tests/test_cases/abbreviated_keywords.py
index baf6a35..17a4793 100644
--- a/tests/test_cases/abbreviated_keywords.py
+++ b/tests/test_cases/abbreviated_keywords.py
@@ -1,2 +1,2 @@
-query = "SELECT ABS(clmn) FROM tbl"  # Q442
-query = "SELECT ABSOLUTE(clmn) FROM tbl"
+query = "SELECT CHAR_LENGTH(clmn) FROM tbl"  # Q442
+query = "SELECT CHARACTER_LENGTH(clmn) FROM tbl"