> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> تنشئ جدولًا من ملفات موجودة في HDFS. تشبه دالة الجدول هذه دالتي الجدول url وfile.

# hdfs

export const CloudNotSupportedBadge = () => {
  return <div className="cloudNotSupportedBadge">
            <div className="cloudNotSupportedIcon">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path strokeWidth="1.5" d="M6.33366 12.6666L12.3739 12.6667C13.6593 12.6667 14.7073 11.6187 14.7073 10.3334C14.7073 9.04804 13.6593 8.00003 12.3739 8.00003C12.3739 8.00003 12.3337 7.66659 12.0003 7.33325M10.667 5.33322C8.00033 2.33325 4.45395 4.78537 4.14195 6.68203C2.55728 6.7627 1.29395 8.06203 1.29395 9.6667C1.29395 11.3234 2.66699 12.6666 4.00033 12.6666" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.5" d="M2.66699 14L12.0003 4.66663" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
            </svg>

        </div>
            غير مدعوم في ClickHouse Cloud
        </div>;
};

export const ExperimentalBadge = () => {
  return <div className="experimentalBadge">
            <div className="experimentalIcon">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path strokeWidth="1.25" d="M5.5 2H10.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.25" d="M9.50015 2V6.19625L13.4283 12.7425C13.4738 12.8183 13.4985 12.9049 13.4996 12.9934C13.5008 13.0818 13.4785 13.169 13.435 13.246C13.3914 13.323 13.3283 13.3871 13.2519 13.4317C13.1755 13.4764 13.0886 13.4999 13.0002 13.5H3.00015C2.91164 13.5 2.8247 13.4766 2.74822 13.432C2.67174 13.3874 2.60847 13.3233 2.56487 13.2463C2.52126 13.1693 2.49889 13.082 2.50004 12.9935C2.50119 12.905 2.52582 12.8184 2.5714 12.7425L6.50015 6.19625V2" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.25" d="M4.47656 9.56754C5.30344 9.41254 6.47656 9.47942 7.99969 10.25C10.0153 11.2707 11.4216 11.0569 12.2184 10.7282" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
            </svg>
        </div>
            ميزة تجريبية. <u><a href="/docs/beta-and-experimental-features#experimental-features">تعرّف على المزيد.</a></u>
        </div>;
};

<div id="hdfs-table-function">
  # دالة الجدول hdfs
</div>

تنشئ جدولًا من ملفات موجودة في HDFS. تشبه دالة الجدول هذه دالتي الجدول [url](/ar/reference/functions/table-functions/url) و[file](/ar/reference/functions/table-functions/file).

<div id="syntax">
  ## البنية
</div>

```sql theme={null}
hdfs(URI, format, structure)
```

<div id="arguments">
  ## الوسائط
</div>

| الوسيطة     | الوصف                                                                                                                                                                                  |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `URI`       | عنوان `URI` النسبي للملف في HDFS. يدعم مسار الملف أنماط `globs` التالية في وضع `readonly`: `*`، `?`، `{abc,def}` و `{N..M}`، حيث إن `N` و `M` — أرقام، و`'abc'` و`'def'` — سلاسل نصية. |
| `format`    | [صيغة](/ar/reference/formats/index) الملف.                                                                                                                                             |
| `structure` | بنية الجدول. الصيغة: `'column1_name column1_type, column2_name column2_type, ...'`.                                                                                                    |

<div id="returned_value">
  ## القيمة المُعادة
</div>

جدول ذو البنية المحددة لقراءة البيانات من الملف المحدد أو كتابتها فيه.

**مثال**

جدول من `hdfs://hdfs1:9000/test` واختيار أول صفين منه:

```sql theme={null}
SELECT *
FROM hdfs('hdfs://hdfs1:9000/test', 'TSV', 'column1 UInt32, column2 UInt32, column3 UInt32')
LIMIT 2
```

```text theme={null}
┌─column1─┬─column2─┬─column3─┐
│       1 │       2 │       3 │
│       3 │       2 │       1 │
└─────────┴─────────┴─────────┘
```

<div id="globs_in_path">
  ## أنماط globs في المسار
</div>

قد تستخدم المسارات `globbing`. ويجب أن تطابق الملفات نمط المسار بالكامل، وليس اللاحقة أو البادئة فقط.

* `*` — يمثّل أي عدد من المحارف باستثناء `/`، بما في ذلك السلسلة الفارغة.
* `**` — يمثّل جميع الملفات داخل مجلد بشكل تكراري.
* `?` — يمثّل محرفًا واحدًا عشوائيًا.
* `{some_string,another_string,yet_another_one}` — يستبدل أيًّا من السلاسل `'some_string', 'another_string', 'yet_another_one'`. ويمكن أن تحتوي السلاسل على الرمز `/`.
* `{N..M}` — يمثّل أي عدد `>= N` و `<= M`.

التركيبات التي تحتوي على `{}` مشابهة لدوال الجداول [remote](/ar/reference/functions/table-functions/remote) و [file](/ar/reference/functions/table-functions/file).

**مثال**

1. لنفترض أن لدينا عدة ملفات بعناوين URI التالية على HDFS:

* 'hdfs\://hdfs1:9000/some\_dir/some\_file\_1'
* 'hdfs\://hdfs1:9000/some\_dir/some\_file\_2'
* 'hdfs\://hdfs1:9000/some\_dir/some\_file\_3'
* 'hdfs\://hdfs1:9000/another\_dir/some\_file\_1'
* 'hdfs\://hdfs1:9000/another\_dir/some\_file\_2'
* 'hdfs\://hdfs1:9000/another\_dir/some\_file\_3'

2. استعلم عن عدد الصفوف في هذه الملفات:

```sql theme={null}
SELECT count(*)
FROM hdfs('hdfs://hdfs1:9000/{some,another}_dir/some_file_{1..3}', 'TSV', 'name String, value UInt32')
```

3. استعلم عن عدد الصفوف في جميع ملفات هذين الدليلين:

```sql theme={null}
SELECT count(*)
FROM hdfs('hdfs://hdfs1:9000/{some,another}_dir/*', 'TSV', 'name String, value UInt32')
```

<Note>
  إذا كانت قائمة الملفات لديك تتضمن نطاقات رقمية تبدأ بأصفار، فاستخدم الصيغة التي تعتمد على الأقواس المعقوفة لكل رقم على حدة، أو استخدم `?`.
</Note>

**مثال**

استعلم عن البيانات من الملفات المسماة `file000` و`file001` و... و`file999`:

```sql theme={null}
SELECT count(*)
FROM hdfs('hdfs://hdfs1:9000/big_dir/file{0..9}{0..9}{0..9}', 'CSV', 'name String, value UInt32')
```

<div id="virtual-columns">
  ## الأعمدة الافتراضية
</div>

* `_path` — مسار الملف. النوع: `LowCardinality(String)`.
* `_file` — اسم الملف. النوع: `LowCardinality(String)`.
* `_size` — حجم الملف بالبايت. النوع: `Nullable(UInt64)`. إذا كان الحجم غير معروف، تكون القيمة `NULL`.
* `_time` — وقت آخر تعديل للملف. النوع: `Nullable(DateTime)`. إذا كان الوقت غير معروف، تكون القيمة `NULL`.

<div id="hive-style-partitioning">
  ## إعداد use\_hive\_partitioning
</div>

عند تعيين `use_hive_partitioning` إلى 1، سيكتشف ClickHouse التقسيم بأسلوب Hive في المسار (`/name=value/`)، وسيتيح استخدام أعمدة التقسيم كأعمدة افتراضية في الاستعلام. وستحمل هذه الأعمدة الافتراضية الأسماء نفسها الموجودة في مسار التقسيم.

**مثال**

استخدام عمود افتراضي أُنشئ باستخدام التقسيم بأسلوب Hive

```sql theme={null}
SELECT * FROM HDFS('hdfs://hdfs1:9000/data/path/date=*/country=*/code=*/*.parquet') WHERE date > '2020-01-01' AND country = 'Netherlands' AND code = 42;
```

<div id="storage-settings">
  ## إعدادات التخزين
</div>

* [hdfs\_truncate\_on\_insert](/ar/reference/settings/session-settings#hdfs_truncate_on_insert) - يسمح باقتطاع الملف قبل الإدراج فيه. يكون معطّلًا افتراضيًا.
* [hdfs\_create\_new\_file\_on\_insert](/ar/reference/settings/session-settings#hdfs_create_new_file_on_insert) - يسمح بإنشاء ملف جديد عند كل عملية إدراج إذا كان للتنسيق لاحقة. يكون معطّلًا افتراضيًا.
* [hdfs\_skip\_empty\_files](/ar/reference/settings/session-settings#hdfs_skip_empty_files) - يسمح بتخطي الملفات الفارغة أثناء القراءة. يكون معطّلًا افتراضيًا.

<div id="related">
  ## مواضيع ذات صلة
</div>

* [الأعمدة الافتراضية](/ar/reference/engines/table-engines/index#table_engines-virtual_columns)
