

 Amazon Redshift tidak akan lagi mendukung pembuatan UDF Python baru mulai Patch 198. UDF Python yang ada akan terus berfungsi hingga 30 Juni 2026. Untuk informasi lebih lanjut, lihat [posting blog](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# UBAH CONTOH TABEL EKSTERNAL
<a name="r_ALTER_TABLE_external-table"></a>

Contoh berikut menggunakan bucket Amazon S3 yang terletak di Wilayah AS Timur (Virginia Utara) (`us-east-1`) AWS Region dan tabel contoh yang dibuat [Contoh](r_CREATE_EXTERNAL_TABLE_examples.md) untuk CREATE TABLE. Untuk informasi selengkapnya tentang cara menggunakan partisi dengan tabel eksternal, lihat[Mempartisi tabel eksternal Redshift Spectrum](c-spectrum-external-tables.md#c-spectrum-external-tables-partitioning). 

Contoh berikut menetapkan properti tabel NumRows untuk tabel SPECTRUM.SALES eksternal untuk 170.000 baris.

```
alter table spectrum.sales
set table properties ('numRows'='170000');
```

Contoh berikut mengubah lokasi untuk tabel SPECTRUM.SALES eksternal.

```
alter table spectrum.sales
set location 's3://redshift-downloads/tickit/spectrum/sales/';
```

Contoh berikut mengubah format untuk tabel SPECTRUM.SALES eksternal ke Parket.

```
alter table spectrum.sales
set file format parquet;
```

Contoh berikut menambahkan satu partisi untuk tabel SPECTRUM.SALES \_PART.

```
alter table spectrum.sales_part
add if not exists partition(saledate='2008-01-01')
location 's3://redshift-downloads/tickit/spectrum/sales_partition/saledate=2008-01/';
```

Contoh berikut menambahkan tiga partisi untuk tabel SPECTRUM.SALES \_PART.

```
alter table spectrum.sales_part add if not exists
partition(saledate='2008-01-01')
location 's3://redshift-downloads/tickit/spectrum/sales_partition/saledate=2008-01/'
partition(saledate='2008-02-01')
location 's3://redshift-downloads/tickit/spectrum/sales_partition/saledate=2008-02/'
partition(saledate='2008-03-01')
location 's3://redshift-downloads/tickit/spectrum/sales_partition/saledate=2008-03/';
```

Contoh berikut mengubah SPECTRUM.SALES \_PART untuk menjatuhkan partisi dengan. `saledate='2008-01-01''`

```
alter table spectrum.sales_part
drop partition(saledate='2008-01-01');
```

Contoh berikut menetapkan jalur Amazon S3 baru untuk partisi dengan. `saledate='2008-01-01'`

```
alter table spectrum.sales_part
partition(saledate='2008-01-01')
set location 's3://redshift-downloads/tickit/spectrum/sales_partition/saledate=2008-01-01/';
```

Contoh berikut mengubah nama `sales_date` menjadi`transaction_date`. 

```
alter table spectrum.sales rename column sales_date to transaction_date;
```

Contoh berikut menetapkan pemetaan kolom ke pemetaan posisi untuk tabel eksternal yang menggunakan format kolom baris (ORC) yang dioptimalkan.

```
alter table spectrum.orc_example
set table properties('orc.schema.resolution'='position');
```

Contoh berikut menetapkan pemetaan kolom untuk pemetaan nama untuk tabel eksternal yang menggunakan format ORC.

```
alter table spectrum.orc_example
set table properties('orc.schema.resolution'='name');
```