.. _version_3.3.0:

=============
Version 3.3.0
=============

Released on 2019/03/27.

.. NOTE::

    If you are upgrading a cluster, you must be running CrateDB 2.0.4 or higher
    before you upgrade to 3.3.0.

    We recommend that you upgrade to the latest 3.2 release before moving to
    3.3.0.

    You cannot perform a `rolling upgrade`_ to this version. Any upgrade to
    this version will require a `full restart upgrade`_.

    When restarting, CrateDB will migrate indexes to a newer format. Depending
    on the amount of data, this may delay node start-up time.

    Please consult the :ref:`version_3.0.0_upgrade_notes` before upgrading.

.. WARNING::

    Tables that were created prior to upgrading to CrateDB 2.x will not
    function with 3.3 and must be recreated before moving to 3.3.x.

    You can recreate tables using ``COPY TO`` and ``COPY FROM`` while running a
    2.x release into a new table, or by `inserting the data into a new table`_.

    Before upgrading, you should `back up your data`_.

.. _rolling upgrade: https://crate.io/docs/crate/howtos/en/latest/admin/rolling-upgrade.html
.. _full restart upgrade: https://crate.io/docs/crate/howtos/en/latest/admin/full-restart-upgrade.html
.. _back up your data: https://crate.io/docs/crate/reference/en/latest/admin/snapshots.html
.. _inserting the data into a new table: https://crate.io/docs/crate/reference/en/latest/admin/system-information.html#tables-need-to-be-recreated

.. rubric:: Table of contents

.. contents::
   :local:


.. _version_3.3.0_upgrade_notes:

Upgrade Notes
=============


Deprecated Settings and Features
--------------------------------

The query frequency and average duration :ref:`query_stats_mbean` metrics has
now been deprecated, in favour of the new total count and sum of durations
metrics.

The ``cluster.graceful_stop.reallocate`` setting has been marked as deprecated.
This setting was already being ignored, and setting the value to ``false`` had
no effect.

The node decommission using the ``USR2`` :ref:`signals <cli-crate-signals>` has
now been deprecated in favour of the :ref:`ALTER CLUSTER DECOMMISSION
<alter_cluster_decommission>` statement.

The ``CREATE INGEST`` and ``DROP INGEST`` rules have been marked as
deprecated. Given that the only implementation (MQTT) was deprecated and will
be removed, the framework itself will also be removed.


Changelog
=========

Changes
-------

New Features
~~~~~~~~~~~~

- Exposed the sum of durations, total, and failed count metrics under the
  :ref:`query_stats_mbean` for ``QUERY``, ``INSERT``, ``UPDATE``, ``DELETE``,
  ``MANAGEMENT``, ``DDL``, and ``COPY`` statement types.

- Exposed the sum of statement durations, total, and failed count classified by
  statement type under the ``sum_of_durations``, ``total_count`` and
  ``failed_count`` columns, respectively, in the :ref:`sys-jobs-metrics` table.


SQL Improvements
~~~~~~~~~~~~~~~~

- Added ``current_schemas(boolean)`` :ref:`scalar function <scalar-functions>`
  which will return the names of schemas in the ``search_path``.

- Added support for the ``first_value``, ``last_value``, and ``nth_value``
  :ref:`window functions <window-functions>` as enterprise features.

- Added the ``DROP ANALYZER`` statement to support removal of custom analyzer
  definitions from the cluster.

- Output the custom analyzer, tokenizer, token_filter, and char_filter
  definition inside the ``information_schema.routines.routine_definition``
  column.

- Added support for the ``row_number()`` window function.

- Added support for using any :ref:`expression <gloss-expression>` in the
  operand of a ``CASE`` clause.

- Fix quoting of identifiers that contain leading digits or spaces when
  printing relation or column names.


PostgreSQL Compatibility
~~~~~~~~~~~~~~~~~~~~~~~~

- Added ``pg_type`` columns: ``typlen``, ``typarray``, ``typnotnull``, and
  ``typnamespace`` for improved PostgreSQL compatibility.

- Added a ``pg_description`` table to the ``pg_catalog`` schema for improved
  PostgreSQL compatibility.

- Fixed :ref:`function <gloss-function>` resolution for PostgreSQL functions
  ``pg_backend_pid``, ``pg_get_expr``, and ``current_database`` when the schema
  prefix ``pg_catalog`` is included.


Database Administration
~~~~~~~~~~~~~~~~~~~~~~~

- Added a node check for the JVM version number.

- Added ``ALTER CLUSTER DECOMMISSION <nodeId | nodeName>`` statement that
  triggers the existing node decommission functionality.

- Changed the trial license introduced in 3.2 to no longer have an expiration
  date, but instead be limited to three nodes.

- The :ref:`usage_data_collector` now includes information about the available
  number of processors.

Deprecations
~~~~~~~~~~~~

- The query frequency and average duration :ref:`query_stats_mbean` metrics has
  been deprecated in favour of the new total count and sum of durations
  metrics.

- Marked the ``cluster.graceful_stop.reallocate`` setting as deprecated.  This
  setting was already being ignored, setting the value to ``false`` has no
  effect.

- The node decommission using the ``USR2`` :ref:`signal <cli-crate-signals>`
  has been deprecated in favour of the :ref:`ALTER CLUSTER DECOMMISSION
  <alter_cluster_decommission>` statement.

- Marked ``CREATE INGEST`` and ``DROP INGEST`` as deprecated.  Given that the
  only implementation (MQTT) was deprecated and will be removed, the framework
  itself will also be removed.

Other
~~~~~

- Buffer the file output of ``COPY TO`` operations to improve performance by
  not writing to disk on every row.
